// the find
jart/sectorlisp
Bootstrapping LISP in a Boot Sector
A 512-byte i8086 LISP implementation that fits in a boot sector and can bootstrap McCarthy's meta-circular evaluator on bare metal. Comes with a portable C reference implementation and the evaluator written in pure LISP. This is a CS curiosity project, not a production tool — the audience is people who care about the theoretical minimum of what LISP is.
The assembly implementation is genuinely impressive: fitting a working LISP with a meta-circular evaluator into 512 bytes is a real constraint satisfaction achievement. The lisp.lisp file strips McCarthy's original evaluator down to only the essential primitives, removing LABEL and fixing the known bugs — it's a cleaner formulation than the 1960s paper. The C reference implementation (lisp.c) provides a readable baseline that makes the assembly legible by comparison. The bestline.c inclusion gives readline-like editing without depending on libreadline, which keeps the build self-contained.
The project is complete in the sense that it does exactly what it set out to do and nothing more — there's no GC, no numbers, no I/O beyond what the meta-circular evaluator demonstrates, so you hit a wall fast if you want to write anything real. The 8086 target means it only runs in emulators or on hardware that barely exists anymore; the practical use case is zero beyond education. Documentation lives mostly in the README and a wiki that may drift; the assembly source lacks inline comments explaining the encoding tricks, so reading sectorlisp.S cold is opaque. No tail-call optimization means non-trivial recursion will smash whatever stack the boot sector gives you.