Ask HN: Clean Lisp implementation for study?

18 points by vu3rdd ↗ HN
I am currently learning Common Lisp and would like to study a well written Lisp Implementation for study to look inside how Lisp is implemented and also to learn the idioms of the language. What would the readers suggest? Thanks.

17 comments

[ 4.3 ms ] story [ 40.7 ms ] thread
I wrote a version of McCarthy's original Lisp in Python if you want to study the roots of Lisp.

http://github.com/fogus/lithp

"I have touched on functional programming with the grace and emotion of a lover."

I feel dirty.

BTW - I just "got" the name of your project you clever project namer.

I'm far from being an expert but "Lisp in small pieces" is frequently recommended.

There are a lot of free/opensource implementations to study. SBCL is widely used and ppl working on it are available in #lisp. It may be the same for ClozureCL.

""Lisp in small pieces" is frequently recommended."

Lisp In Small Pieces covers everything except the garbage collector.

Truth to tell I haven't yet seen a "how to implement a lisp" tutorial that implements all the bits - macros , gc etc. You might have to dig into source code. SIOD is just a little crufty but it has all the pieces in very little code.

Wilson handles GC perfectly. LiSP is written from the perspective of implementing Lisp in Lisp.
T 3.0

http://mumble.net/~jar/tproject/t3.0.tar.gz

The most beautiful compiler for any language.

P.S. Why not ask the specialists? the people hacking Lisp compilers for the love of it; unpaid and unsung heroes? Drop by #lisp or #scheme in Freenode and see who is there. Most competent Lisp compiler hackers wouldn't be caught dead in this neck of the woods; it's just us web guys, blowhards and joe nobodies.

(comment deleted)
LispKit lisp is a pretty good example. A good description exists in "Functional Programming: Application and Implementation" by Peter Henderson.
Thanks for the comments. I have started looking at the provided pointers.
i think this article is great, i read it, then downloaded the source to jscheme, and ported a portion of it to ruby. then i understood more about how lisp works, i got to a working repl that had + implemented.

http://berlinbrowndev.blogspot.com/2008/07/simple-lisp-imple...

then half a year later I thought what the hell and sneaked in a production app written in clojure to one of our tomcats. for me learning something new is always about porting it to something familiar to grok the basics and then force myself to write real code, then there's no avoidance of those important details

I actually like newLisp - not exactly Common Lisp, but I find the implementation easy to follow. check it out on www.newlisp.org. Compiles just about anywhere and comes with a nice testing framework so you can regression test your changes, etc.
Scheme 9 from Empty Space is both a small Scheme implementation and a book describing the source code. I read 60% of the book this summer, and wasn't disappointed.

Written in portable C, it implements bignums, garbage collection, (nonhygienic) macros, hashed environments.

http://www.bcl.hamilton.ie/~nmh/t3x.org/zzz/