Earlier quoted context omitted.
Certainly not the worst I have seen, by far; but yes, not pretty. IMHO “Just for making it shorter“. I would very much prefer 200 lines of actually readable nice code.
For reading, I enjoyed fe, which was very clear: https://news.ycombinator.com/item?id=36239175
A Lisp in 99LOC
21–28 of 28 posts
Re: A Lisp in 99LOC
#22Earlier quoted context omitted.
Yeah. It's munged to fit in 99 lines.
That's besides my point, which is why I said "structure, not just expression". It could've used a struct rather than wedging tags into a double's first byte and still be 99 lines.
Re: A Lisp in 99LOC
#23Kinda reminds me J-flavored Whitney's one-page J interpreter.
Re: A Lisp in 99LOC
#24Lisp in ~100 lines of Python: https://flownet.com/ron/l.py
Can’t you just “import lisp”?
Python 3.11.6 (v3.11.6:8b6ee5ba3b, Oct 2 2023, 11:18:21) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import lisp
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'lisp'Re: A Lisp in 99LOC
#25Re: A Lisp in 99LOC
#26can it execute the y-combinator?
I’m pretty sure does not handle TCO… so probably not, unless with a huge stack.
https://github.com/Robert-van-Engelen/tinylisp/blob/2d0fb35b...
Re: A Lisp in 99LOC
#27Holy cow this is —structurally, not just expression— some of the worst C code I have ever seen, with the abuse of the 'double' type, 'T' cast that looks like a declaration, endian dependency, and strict aliasing violations galore… does this even work on a modern compiler? o.O
Surpringly readable though, despite all that, if you've ever implanted a language in similar constraints.
Too late to edit now.