A Lisp in 99LOC
8 days ago
- #Interpreter
- #Lisp
- #C Programming
- Project honors Church and McCarthy by demonstrating how to write a tiny Lisp interpreter in C or similar languages.
- The interpreter includes 21 built-in Lisp primitives, garbage collection, and a REPL, making it practical beyond a toy example.
- Features like static scoping, double precision floating point, and tail-call optimization are supported.
- Multiple versions of the interpreter are available, including optimized and commented variants.
- The project demonstrates Lisp's core concepts: symbols, lists, functions (lambda), and special forms like quote, eval, and cond.
- Additional functionalities like macros, backquoting, and exception handling are introduced in extended versions.
- Instructions for compiling and extending the interpreter are provided, including memory management tips.
- The article also references two other Lisp implementations with more features and different garbage collection strategies.