Lisp in ~100 lines of Python:
A better starting point:
https://github.com/Robert-van-Engelen/tinylisp/blob/main/tin...
Holy 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.
It does not, because there is a syntax error on line 81 (extra close parenthesis):
https://github.com/Robert-van-Engelen/tinylisp/blob/2d0fb35b...
Brought to you by this marvellous commit with the message "update",
https://github.com/Robert-van-Engelen/tinylisp/commit/40c6c0...
Yeah. It's munged to fit in 99 lines.
That's not my point, which is why I said "structure, not just expression".
It could've used s struct rather than wedging tags into a double's first byte and still be 99 lines.
can it execute the y-combinator?
It doesn't appear to, but you could always add this to the included common.lisp file:
(define Y (lambda (f) (lambda args ((f (Y f)) . args))))