(How to Write a (Lisp) Interpreter (In Python)) (2010)
tosh
176 points
57 comments
June 21, 2026
Related Discussions
Found 5 related stories in 111.4ms across 11,176 title embeddings via pgvector HNSW
- (An ((Even Better) Lisp) Interpreter (In Python)) vismit2000 · 44 pts · May 31, 2026 · 81% similar
- How to make a fast dynamic language interpreter pizlonator · 117 pts · April 21, 2026 · 55% similar
- Linux is an interpreter frizlab · 183 pts · March 28, 2026 · 51% similar
- Try LispE in the Browser clauderoux · 31 pts · May 13, 2026 · 49% similar
- Retrofitting JIT Compilers into C Interpreters ltratt · 65 pts · April 15, 2026 · 47% similar
Discussion Highlights (18 comments)
tosh
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.
urcite_ty_kokos
Appreciated the title xD
zahlman
(how-to in-python (write (interpreter lisp)))
azhenley
Writing a Lisp is one of my favorite projects. I try to do it every year or two, taking a different approach each time.
chombier
If you ever wondered how to write a programming language, this is probably the best resource to get started (and then of course Crafting Interpreters). See also part 2 https://norvig.com/lispy2.html
librasteve
or you could just use Raku and its “surprisingly good lisp impression”: https://www.codesections.com/blog/raku-lisp-impression/
joshuamorton
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.
RedCinnabar
Man these kind of resources have aged really bad in the age of AI.
timonoko
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
dang
Is it classics day or something? (Fine with us!) Related: (How to Write a (Lisp) Interpreter (In Python)) (2010) - https://news.ycombinator.com/item?id=39665939 - March 2024 (91 comments) (How to Write a (Lisp) Interpreter (In Python)) (2010) - https://news.ycombinator.com/item?id=30443949 - Feb 2022 (9 comments) (How to Write a (Lisp) Interpreter (In Python)) - https://news.ycombinator.com/item?id=30327437 - Feb 2022 (3 comments) (How to Write a (Lisp) Interpreter (In Python)) - https://news.ycombinator.com/item?id=26036431 - Feb 2021 (1 comment) How to Write a Lisp Interpreter In Python (2010) - https://news.ycombinator.com/item?id=20590439 - Aug 2019 (29 comments) How to Write a Lisp Interpreter in Python (2010) - https://news.ycombinator.com/item?id=12777852 - Oct 2016 (28 comments) How to Write a Lisp Interpreter in Python (2010) - https://news.ycombinator.com/item?id=7825054 - May 2014 (41 comments) (How to Write a ((Better) Lisp) Interpreter (in Python)) - https://news.ycombinator.com/item?id=1746916 - Oct 2010 (10 comments) (How to Write a (Lisp) Interpreter (in Python)) - https://news.ycombinator.com/item?id=1745322 - Sept 2010 (39 comments)
timonoko
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. https://github.com/timonoko/nokolisp
sashank_1509
Depressing to think that AI will be doing most of this in the future. Sharing it freely in the internet, basically ensures AI can copy it well.
adamddev1
Interestingly enough, linguists also use Lisp-like parentheses or brackets to annotate sentence structures. Trees and brackets are isomorphic, as both phrase structure grammarians and the original SICP lectures pointed out. The brackets in the title sentence would look a lot different though. ;-)
userbinator
And in the other direction, here's a Python interpreter written in Lisp: https://github.com/metawilm/cl-python
leonardool
I've been working on a similar (ish) project for a while: Ribbit ( https://github.com/udem-dlteam/ribbit ). Supports a full R4RS REPL (with tail-calls) in the same sizes as Lispy (8Kb for JavaScript and 6.5Kb for x86)!
ljcoco
article to follow between all the ai noises these days
mathnode
;;;; Not sorry )
wmedrano
I made a rusty version of this. No linked lists, but that's not important in the grand Scheme of things. https://wmedrano.dev/post/2025/11/15/lisp-1