A TypeScript implementation of a minimal compiler that transforms LISP-style function calls into C syntax.
Transforms this:
(add 2 (subtract 4 2))Into this:
add(2, subtract(4, 2));- Tokenizer: Lexical analysis of input
- Parser: Builds Abstract Syntax Tree (AST)
- Transformer: Converts LISP AST to C AST
- Code Generator: Outputs C code
- Full TypeScript: Type-safe implementation with proper interfaces
# Install dependencies
npm install
# Build the project
npm run build
# Run the example
npm run startThis project is a TypeScript adaptation of The Super Tiny Compiler by @jamiebuilds
- Converted from JavaScript to TypeScript
- Added comprehensive type definitions
- Separated types into dedicated module
- Added ES module support
This derivative work is also licensed under CC BY 4.0.
This is a learning project. Feel free to fork and experiment!