Live data from Hacker News

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

norvig.com

1–10 of 101 posts

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

#3
One main thing that one gets for free this way is garbage collection. I once started writing a lisp iterpreter in C++ but that kind of fell by the wayside once I realized that it is quite easy to create cyclical references in lisp and then using shared_ptr is not good enough.

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

#6
> The beauty of Scheme is that the full language only needs 5 keywords and 8 syntactic forms.

Is there a learning resource that covers exactly this for those wanting to write software in lisp in 2024?

As "first principle thinkers" in some ways all hackers crave for that "fundamental building blocks approach", a bit like wanting to know how we go from transistors to full computers and every step along the way. Most of us have made peace with accepting the many abstractions because we're slinging highly abstracted mostly python, and javascript code at startups.

So learning Lisp seems like a nice digestible point to start from along the continuum if indeed there's some eloquent way to learn: >only needs 5 keywords and 8 syntactic forms.

and then be off to the races, so to speak.

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

#9

> The beauty of Scheme is that the full language only needs 5 keywords and 8 syntactic forms. Is there a learning resource that covers exactly this for those wanting to write software in lisp in 2024? As "first principle thinkers" in some ways all hackers crave for that "fundamental building blocks approach", a bit like wanting to know how we go from transistors to full computers and every step along the way. Most of…

Various Scheme texts cover writing your own interpreter in more or less detail: Structure and Interpretation of Computer Programs (AKA SICP)*, the Little Schemer, Concrete Abstractions**. Norvig's Paradigms of AI Programming also contains a Scheme interpreter, though the text mainly focuses on Common Lisp. And finally I'd throw Exploring Programming Language Architecture in Perl*** in the mix as a more in-depth look at creating a Scheme interpreter.

The style of the Little/Seasoned/Reasoned Schemer is a little different from the other books I highlighted here, but various people have said they really like it, including Guy Steele, so they may be worth a look if the others don't really work for you.

*: https://mitp-content-server.mit.edu/books/content/sectbyfn/b...>

**: https://gustavus.edu/academics/departments/mathematics-compu...>

***: https://www.billhails.net/Book/front.html>

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

#10

> The beauty of Scheme is that the full language only needs 5 keywords and 8 syntactic forms. Is there a learning resource that covers exactly this for those wanting to write software in lisp in 2024? As "first principle thinkers" in some ways all hackers crave for that "fundamental building blocks approach", a bit like wanting to know how we go from transistors to full computers and every step along the way. Most of…

You could start with The Roots of Lisp, by pg: https://www.paulgraham.com/rootsoflisp.html

In the same vein, it is also fun to have a look at church-encoding in lambda calculus and to play with it in the language you choose.

Post reply on HN