lexLeo is a Lisp-like programming language interpreter with a C-style syntax. It is designed as an educational and experimental project focused on the implementation of language semantics, evaluation models, and interpreter architecture.
The project explores core concepts found in Lisp-inspired languages such as:
- symbolic expressions and values,
- first-class functions,
- dynamic evaluation (
eval), - quotation and delayed evaluation (
quote), - explicit environments and runtime state.
Unlike traditional Lisp dialects, lexLeo deliberately adopts a more C-like surface syntax, while preserving Lisp-style semantics and execution principles.
đ Full documentation is available at:
https://caltuli.online/lexleo
lexLeo is primarily an educational project aimed at deepening the understanding of programming language implementation, with a strong emphasis on interpreters rather than compilation.
The project focuses on:
- lexical analysis and parsing,
- abstract syntax trees (AST),
- environment-based evaluation,
- runtime value representation,
- memory management and execution flow.
By concentrating on interpretation instead of compilation, lexLeo prioritizes clarity, correctness, and architectural soundness over breadth of features.
Beyond language theory, lexLeo is also a practical exercise in professional software engineering. The project emphasizes:
- clean and modular C architecture,
- explicit dependency injection,
- test-driven development (TDD),
- robust build configuration using CMake,
- memory abstraction through an OSAL layer,
- automated documentation generation with Doxygen.
lexLeo is intended as a serious portfolio project, demonstrating not only knowledge of language design, but also the ability to structure, document, and maintain a non-trivial C codebase to professional standards.
At its current stage, lexLeo provides:
- a Lisp-like interpreter with a well-defined evaluation model,
- a modular lexer and parser architecture,
- an explicit runtime environment and symbol management,
- a strong emphasis on correctness, testability, and maintainability.
A compiler backend is intentionally out of scope for now, in order to keep the project focused and technically rigorous.
To get started with lexLeo, clone this repository to your local machine:
git clone https://github.com/workaholic-v-0-0-0/lexLeo.git
cd lexLeoEnsure you have the following installed on your system:
- GCC (or any preferred C compiler)
- CMake
- A generator as Make or Visual Studio 2022 17
To build the compiler and interpreter using CMake, follow these steps:
cmake -B build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF
cmake --build buildcmake -B build -G "Visual Studio 17 2022" -A x64 -DBUILD_TESTING=OFF
cmake --build build --config Releasecmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF
cmake --build buildBy default, BUILD_TESTING is ON, but you can specify it explicitly for clarity.
rm -r build
cmake -B build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON
cmake --build build
cmake --build build --target check
cmake --build build --target check_memoryrm -r build
cmake -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON
cmake --build build --config Debug
cmake --build build --target check
cmake --build build --target check_memory rm -r build
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON
cmake --build build
cmake --build build --target check
cmake --build build --target check_memoryAfter building the project, you can run the executable directly from the project directory:
./build/lexLeo_cli.\build\Release\lexLeo_cli.exe./build/lexLeo_cli./scripts/re_debug_build-make_and_open_doc.sh./scripts/re_debug_build-check.sh ./scripts/re_debug_build-check_memory.sh./scripts/update_docs_on_droplet.sh - Lexer / Parser design draft:
- [Module layout standards](@ref arch_standards_module_layout)
- [Type standards](@ref arch_standards_types)
- [Naming conventions](@ref arch_standards_naming)
- [Module context model](@ref module_context_model)
- [Lifecycle Visibility Rules (create / destroy)](@ref lifecycle_visibility_rules)
- [lexleo_flex module](@ref lexleo_flex_module)
Contributions to the lexLeo project are welcome! Whether it involves fixing bugs, adding new features, or improving documentation, your help is appreciated. Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests to us.
lexLeo is licensed under the GNU General Public License v3.0 or later.
This project uses the following third-party components:
- Flex (BSD-like license with exception)
- Bison (GPL with special exception)
- Standard C library (glibc / musl, LGPL)
These components are compatible with the GPLv3 and impose no additional restrictions on the distribution of lexLeo.