{"id":21221943,"url":"https://github.com/fontseca/lexemn","last_synced_at":"2025-07-10T13:33:02.715Z","repository":{"id":61775417,"uuid":"553079909","full_name":"fontseca/lexemn","owner":"fontseca","description":"Lexemn is a high level programming language for interpreting and evaluating mathematical expressions. It will also feature the capability to plot functions and solve basic equations.","archived":true,"fork":false,"pushed_at":"2022-12-27T16:23:36.000Z","size":585,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T01:15:05.709Z","etag":null,"topics":["cmake","cpp","interpreter","lexing","mathematics","parsing","programming-language"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fontseca.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-17T17:23:32.000Z","updated_at":"2024-07-30T02:55:14.000Z","dependencies_parsed_at":"2023-01-31T05:00:58.875Z","dependency_job_id":null,"html_url":"https://github.com/fontseca/lexemn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fontseca/lexemn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fontseca%2Flexemn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fontseca%2Flexemn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fontseca%2Flexemn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fontseca%2Flexemn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fontseca","download_url":"https://codeload.github.com/fontseca/lexemn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fontseca%2Flexemn/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264585371,"owners_count":23632646,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmake","cpp","interpreter","lexing","mathematics","parsing","programming-language"],"created_at":"2024-11-20T22:37:01.961Z","updated_at":"2025-07-10T13:33:01.379Z","avatar_url":"https://github.com/fontseca.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lexemn Programming Language\n\nThis is the source code of the domain specific interpreted\nprogramming language named Lexemn. It was named after the word lexeme\n(which is the cornerstone in the heart of any natural or formal\nlanguage). The word Lexemn is pronounced smonething like \u003ci\u003e/'lɛkszæm/\u003c/i\u003e.\n\n![Lexemn Logo](./assets/lexemn-logo.png)\n\n# Overview\n\nLexemn is a high level programming language for interpreting and\nevaluating mathematical expressions. It will also feature the capability\nto plot functions and solve basic equations.\n\nLexemn is an object oriented language with a libraries that support\nbasic mathematical abstractions such as matrixes and vectors. These\nare the abstractions that lengthen the power of the language.\n\n# Language Syntax\n\nThe syntax of Lexemn is pretty similar to mathematical expressions. It\nsupports Unicode graphemes to extend the language power by naming\nfamiliar function or symbols such as π. Although it supports these\nsymbols, it is not an imposition to use them in systems that do not\nhave compatibility with Unicode.\n\n## Function Definitions\n\n![Function definitions](./assets/Screenshot%20from%202022-12-19%2011-50-35.png)\n\nThe code snippet above is a shorthand version for the following code:\n\n![Function definitions](./assets/Screenshot%20from%202022-12-19%2011-52-40.png)\n\n## Variable Definitions\n\n![Variable definitions](./assets/Screenshot%20from%202022-12-19%2012-00-27.png)\n\n![Variable definitions](./assets/Screenshot%20from%202022-12-19%2012-03-29.png)\n\n## Defining a Class\n\n\n![Defining a class](./assets/Screenshot%20from%202022-12-19%2012-05-40.png)\n\n# Code Structure\n\nHere is an explanation of the project's structure and what you can\nfind inside each directory:\n\n- `src/`: Holds the core implementations for the language.\n\n- `grammar/`: Holds the grammar for the Lexemn language.\n\n- `include/`: Declarations for the abstractions used by the language.\n\n- `doc/`: The official documentation of the language.\n\n# Terminology\n\nThe interpreter uses an abstraction called **book** (or **Lexemn book**) whose purpose is to arrange a collection of **pages** (or **Lexemn pages**) during the lifecycle of the program. When the interpreter starts running, a new book created and it serves as a session that stores in memory a log of the user inserted expressions and computations.\n\nA **page** abstracts a file with correct Lexemn instructions. When the interpreter is running in interactive mode, each expression entered by the user is treated as a single page and stored in a unique book.\n\nWhen the interpreter is fed with source files, it creates a single book and transforms those files into pages arranged by that book.\n\nThe term page was chosen because it can be thought as a physical page filled with mathematical symbols and epxression in a book.\n\n# Building\n\nLexemn is currently only available for GNU/Linux. To run it, you must first\ninstall the dependencies in your system by running the `bootstrap.sh` script.\nIt will install GNU Readline, which is the only dependency by the moment.\n\n## Build with GNU Make\n\nAfter that, you will need GNU Make to compile the project. Once you have it, try running\n\n`make`\n\nand it will create a binary fila inside the `bin` directory and it will send all the object files to the `obj` directory.\n\nTo clean completely the project, run:\n\n`make clean`\n\nto remove the binary and the object files, and after that run\n\n`make cleandir`\n\nwhich is going to remove the `bin` and `obj` direcotries.\n\n## Build with CMake\n\nYou can also build Lexemn with CMake. So, first make a directory called `build` at the root. Then,\n\n  `$ cd build`,\n\nand after that run:\n\n `$ cmake -DCMAKE_BUILD_TYPE=Debug -S .. -B .`,\n\nand then:\n\n `$ cmake --build .`.\n\n# Running\n\nIf you built Lexemn with GNU Make, you can run it by simply executing the binary file inside the `bin`\ndirectory:\n\n`./bin/lexemn`. Otherwise, there will be a `bin` directory inside the `build` folder.\n\nIf you do not specify any file with the extension `lxmn', the interpreter will run in interactive mode. If you pass one or more files, it will also run in interactive mode, but this time you will be able to access defined objects inside any of those files.\n\n# Feature Requests\n\nIf you would like to add a feature either to the language, please try to get some sort of consensus that it is a worthwhile addition and open an issue with the lable `enchancement`. Please try to include enough description and justification about your new proposition.\n\n# Reporting Bugs\n\nIf you found a bug or have any question, you can open an issue with the lables `bug` or `question` respectively.\n\n# Achievements\n\n- The first implementation of the lexer detects lexical erros.\n\n![Lexical erros detected.](./assets/Screenshot%20from%202022-11-11%2012-15-28.png)\n\n# To-Do\n\nIf you are interested in helping, here are some task you might want to accomplish:\n\n- Complete the language grammar.\n- Write the parser.\n\n# Disclaimer\n\nThe development of Lexemn is currently regarded as an experiment that aims the study concepts and abstractions which are found in the construction of all (or some of) the stages of compilers and interpreters. There is absolutely no warranty that either the interpreter or programming language performs correcty what you might be expecting due to lack of completeness in its initital development phase.\n\nThe specific domain of the language is not guaranteed to  stay throughout its development because it is a subject that might be possibly reviewed in the future. You must also know that the programming language grammar is another subject that can easely be reviewed in the future.\n\nAlthough Lexemn is regarded as an experimental programming language, once the first releases are available, it can be employed in the following cases:\n\n- For students to write, test and maintain mathematical expressions in a safe places (e.g., GitHub).\n\n- For computer programmers who are specialized in mathematics and want to try a new alternative to another similar programming language.\n\n- For software that needs a new alternative to a similar programming language.\n\nFor further information, don't be shy and contact the maintainer of the language [by sending a mail to fonseca.dev@outlook.com](mailto:fonseca.dev@outlook.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffontseca%2Flexemn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffontseca%2Flexemn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffontseca%2Flexemn/lists"}