logoalt Hacker News

(How to Write a (Lisp) Interpreter (In Python)) (2010)

73 pointsby toshtoday at 3:36 PM32 commentsview on HN

Comments

timonokotoday at 6:22 PM

I actually perfected the Norvig Lisp at one time. It has compiler to python and just everything. Those very few here that can actually read code, understand why this project soon exploded into biggest piece of odorous excrement.

https://github.com/timonoko/nokolis.py

chombiertoday at 4:25 PM

[delayed]

zahlmantoday at 3:57 PM

(how-to in-python (write (interpreter lisp)))

timonokotoday at 6:03 PM

One of those exercises that are now just boring, because AI does it better.

My Lisp from 1975 was actually used in real world and highly lucrative. Gemini could read the source code, but it told that my code was piece of shit and cannot be implemented in 64-bit world without drastic changes, so it made an example. But that version was just too advanced and too complex as a study subject. There are already enuff good Lisps in the world, methinks.

show 1 reply
azhenleytoday at 4:09 PM

Writing a Lisp is one of my favorite projects. I try to do it every year or two, taking a different approach each time.

toshtoday at 3:48 PM

I can't recommend highly enough to implement a simple lisp (or a forth).

Illuminating experience and it will also help you see (among many other things) the parentheses in a different light.

show 1 reply
librastevetoday at 4:38 PM

or you could just use Raku and its “surprisingly good lisp impression”:

https://www.codesections.com/blog/raku-lisp-impression/

urcite_ty_kokostoday at 3:51 PM

Appreciated the title xD

joshuamortontoday at 4:46 PM

There are edge cases where this fails, but `def parse(s): return json.loads('['+re.sub('([")])\s*(["(])','\g<1>,\g<2>',re.sub('[^()\s]+','"\g<0>"',s)).replace('(','[').replace(')',']')+']')` is a surprisingly robust lisp parser.

e12etoday at 3:55 PM

(2010)?

timonokotoday at 4:46 PM

[fagged]

show 6 replies
RedCinnabartoday at 5:07 PM

Man these kind of resources have aged really bad in the age of AI.

show 3 replies