Live data from Hacker News

A Lisp in 99LOC

github.com

11–20 of 28 posts

Re: A Lisp in 99LOC

#12
post #3

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

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

#13
post #3

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.

Re: A Lisp in 99LOC

#15
post #3

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

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.

Re: A Lisp in 99LOC

#19
post #15
post #3

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

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

Re: A Lisp in 99LOC

#20
post #12

Earlier 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.

If that's the trick you object to then you will be sad to hear that Ruby uses it.
Post reply on HN