Settings

Theme

A Lisp in 99LOC

github.com

108 points by shikaan 5 months ago · 27 comments

Reader

eqvinox 5 months ago

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

OhMeadhbh 5 months ago

Previously:

* https://news.ycombinator.com/item?id=32100035

* https://news.ycombinator.com/item?id=32095655

and

* https://BI6.US/CO/N/20250420.HTML#/042402

lisper 5 months ago

Lisp in ~100 lines of Python:

https://flownet.com/ron/l.py

  • f1shy 5 months ago

    Or from the venerable: https://norvig.com/lispy.html

  • ginko 5 months ago

    Can’t you just “import lisp”?

    • lisper 5 months ago

      Um, no?

          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 "<stdin>", line 1, in <module>
          ModuleNotFoundError: No module named 'lisp'
nivertech 5 months ago

A better starting point:

https://github.com/Robert-van-Engelen/tinylisp/blob/main/tin...

jhbadger 5 months ago

It's interesting that he seems to have written this for a pocket computer, because there actually was a pocket computer of similar vintage that had LISP built in -- 1989's Casio AI-1000

https://pockemul.com/index.php/2020/04/27/pockemul-1-10-0-ne...

forgotpwd16 5 months ago

>C code in this project is strongly Lisp-like in compact form

Kinda reminds me J-flavored Whitney's one-page J interpreter.

mark_l_watson 5 months ago

The commented longer program listing was fun to read.

coderatlarge 5 months ago

can it execute the y-combinator?

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection