Great Programs To Read

What programs exist (in any language) that are considered great and where the source code is available for people to learn from?

Ideally this page would be populated with examples of programs that one would benefit from reading. On the other hand it's quite difficult to identify examples of GreatProgramsToRead so I'd suggest that we need a page of ProgramsToRead as well. It would serve the same purpose but without the value judgement.


Well, here is a start restricted to fairly unimpeachable code. I don't know of any source-available OO code (any language) that meets this criterion but would be interested to see some.

TeX and MetaFont, both source available or perhaps better, in (literate programming) book form. (See TexTheProgram.)


"ParadigmsOfArtificialIntelligenceProgramming: Case studies in Common Lisp" book by PeterNorvig.

Norvig's more recent book is also full of great programs. "Artificial Intelligence: A Modern Approach" with Stuart Russell.

See both at


The QmailSystem is a very well designed system. It takes about 15K lines of C code to do what sendmail does in 45K, and it is divided into 24 programs, most of which are only a couple of hundred lines long. The biggest program is 3000 lines long.

It was released in 1997 and has not experienced any security failures. The current (2004) version is 1.03.


The Smalltalk basic class libraries are all very well written. The more peripheral classes in both VisualWorks and Squeak have a lot of examples of bad code (Squeak more than VisualWorks), but the core class of both are very good.


JohnVlissides' IvTools and UnidrawFramework


The Art of UNIX Programming by ESR http://www.catb.org/esr/writings/taoup/ features a few case studies.


I learned alot by reading and messing with the WindowLab? source code (http://nickgravgaard.com/windowlab/)

EditText of this page (last edited October 11, 2012) or FindPage with title or text search