Lisp interpreter with GC in <750 lines of Odin (and <500 lines of C)
11 days ago
- #Odin
- #Scheme
- #LISP
- A tribute to the paper 'Recursive Functions of Symbolic Expressions and Their Computation by Machine, Part I'.
- Implementation of a micro-subset of Scheme/LISP in C (komplott.c) and Odin (komplodin.odin).
- The Odin version was refined with input from Odin's creator, gingerBill.
- Features include a single-file implementation, <500 lines of code (600 for Odin), and a copying semi-space garbage collector.
- Limited tail call optimization, near-zero error handling, and no thread safety or security.
- Includes an implementation of LISP 1.5 core from 1962, with slight tweaks to resemble early LISP.
- Build instructions: 'make komplott' for C version, 'make komplodin' for Odin version, and 'make test' to run LISP 1.5 interpreter.
- Example LISP 1.5 code provided, demonstrating functions like MAPCAR and DUP.
- Reading termination requires 'STOP' followed by multiple right parentheses to avoid indefinite reading.