Uncategorized

LISP IN 436 BYTES

You would assume that any programming language available back in the 1960s would be small enough to easily implement on today’s computers. That’s not always true though, since old languages sometimes used multiple passes. but in some cases, you can implement what would have been a full language decades ago in a tiny footprint. A case in point is a pretty good implementation of Lisp — including garbage collection — in 436 bytes.

SectorLISP claims to be the tiniest real language, beaten only by toy languages that are not really very useful. If you want to, you can try it in your browser, but that version has better error messages and persistent bindings, so it hogs up a whole 509 bytes.

Of course, LISP can be an acquired taste, but it is elegant. Some say it is an acronym for “lots of irritating spurious parenthesis” but the structure does make it easy to parse.

Coincidentally, Forth is also easy to parse and SectorForth is one of the slightly larger languages that SectorLISP compares itself to. These tools are meant to live in a small bootsector of a floppy, but who knows where you might want to cram in a tiny scripting language. The fact that SectorLisp takes 436 bytes and the IBM 7090 LISP 1.5 took 32K is probably partly due to the efficiency of the x86 instructions set and partly due to the fact that the 7090 had a much larger environment to live in.

This isn’t the first small LISP we’ve seen. Forth, of course, is a staple.