Moffet is an experimental LLVM-based language frontend built to explore compiler design, program analysis, and LLVM IR generation.
The project focuses on understanding how source code is transformed through lexical analysis, parsing, AST construction, and lowered into LLVM Intermediate Representation (IR).
Moffet currently implements:
- A lexer for tokenizing input
- A recursive-descent parser
- An AST (Abstract Syntax Tree) representation
- Operator precedence parsing
- Basic LLVM IR code generation using
IRBuilder
- Lexical analysis for identifiers, numbers, operators, and keywords
- Parsing of:
- Numeric expressions
- Variable references
- Binary operations
- Function prototypes and calls
- AST-based semantic representation
- Basic code generation for supported expressions
- Interactive REPL-style execution loop
This implementation is experimental and not production-ready:
- Error handling is minimal
- Only a limited subset of language features is supported
- Some components are still under refinement
This project was built to:
- Understand compiler frontend architecture
- Gain familiarity with LLVM internals and IR
Clone the project:
git clone https://github.com/WRenchJr42/moffet_lang.gitNavigate to the project directory:
cd moffet_langRun the interpreter:
./moffet.kai