Ask HN: Clean Lisp implementation for study?
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 ] threadhttp://github.com/fogus/lithp
I feel dirty.
BTW - I just "got" the name of your project you clever project namer.
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 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.
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.
I wrote various long posts here about Lisp hacking bibliography, this is the most recent one:
http://news.ycombinator.com/item?id=835020
Appendix B.
Haskell is a great language to implement other languages in:
http://www.defmacro.org/ramblings/lisp-in-haskell.html
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
Written in portable C, it implements bignums, garbage collection, (nonhygienic) macros, hashed environments.
http://www.bcl.hamilton.ie/~nmh/t3x.org/zzz/