2 ms·
My basic Lisp interpreter was six pages of C, but it's really not usable; it responds to almost any program error (including searching for nonexistent variables
by kragen 16y ago
My basic Lisp interpreter was six pages of C, but it's really not usable; it responds to almost any program error (including searching for nonexistent variables) by dumping core. http://lists.canonical.org/pipermail/kragen-hacks/2007-September/000464.html http://lists.canonical.org/pipermail/kragen-hacks/2007-Septe...
Darius Bacon's https://github.com/darius/ichbins https://github.com/darius/ichbins is a Lisp-to-C compiler written in itself. It includes an interpreter written in C to bootstrap it — ten pages: https://github.com/darius/ichbins/blob/master/boot-terp/lump.c https://github.com/darius/ichbins/blob/master/boot-terp/lump... — but the actual compiler is only six pages of Lisp.
My somewhat more performant (but less complete) Scheme-subset-to-assembly compiler is more like 30 pages: http://www.canonical.org/~kragen/sw/urscheme/ http://www.canonical.org/~kragen/sw/urscheme/
If your desert-island language is the one in which bootstrapping your high-level language of choice is the easiest, it seems like you'd probably be better off with Haskell or ML.