6 ms·
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 ?
- cperciva 18y agoI'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.
- silentbicycle 18y agoFor C, the Lua source is great, and there's a hyperlinked version here - http://www.lua.org/source/5.1/ 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. :)
- deleted 18y ago[deleted]
- scott_s 18y agoFor C, I think the Linux kernel is a good representative: http://miller.cs.wm.edu/lxr3.linux/http/source/?v=2.6.11.12 http://miller.cs.wm.edu/lxr3.linux/http/source/?v=2.6.11.12
- michael_dorfman 18y agoPersonally, I find the Minix3 kernel to be a better read: http://www.minix3.org/doc/ http://www.minix3.org/doc/ The book serves as nice documentation and explanation of the principles (as well as containing the full source, printed.)
- icey 18y agoPeter Norvig has written some very nice Python and Lisp. I think most of the code he has on his website (http://norvig.com/ http://norvig.com/) is in Python, but PAIP is all Lisp.