Ask HN: Interesting code to read

Hi,

Do you know some really interesting code to read (the kind of code that shows best practices in action), in C, python, yacc and lisp ?

  • For C, the Lua source is great, and there's a hyperlinked version here - http://www.lua.org/source/5.1/ . It's written in strictly compliant ANSI C.

    For Lisp and Scheme, try Peter Norvig's _Paradigms of Artificial Intelligence Programming_ and Christian Queinnec's _Lisp in Small Pieces_ (PAIP and LiSP). The former has more Common Lisp, the latter Scheme. Both will give you quite a bit to think about. :)

  • Peter Norvig has written some very nice Python and Lisp. I think most of the code he has on his website (http://norvig.com/) is in Python, but PAIP is all Lisp.

  • I'm a bit biassed here, but several people have told me that they think the tarsnap source code (all in C) is "beautiful", "well designed", "very UNIXy", "incredibly clean", etc.

  • For C, I think the Linux kernel is a good representative: http://miller.cs.wm.edu/lxr3.linux/http/source/?v=2.6.11.12