Home

Literate programming is all about explaining how computer programs work at the same time as actually getting them to work. If you are the sort of person who likes explaining things to an audience, you will probably like literate programming. (If not, you probably won't.)

Knuth introduced the ideas of literate programming in the early 1980s through a pre-processible form of Pascal which he called WEB (described in a famous paper published in The Computer Journal in 1984.) Since then, the ideas has been adapted to many other programming languages, and even a language-independent idiom called noweb. The most comprehensive current reference is Daniel Mall's literate programming site.

There are three keys ideas in literate programming.

The basic tools for writing literate programs are the preprocessors tangle and weave (or similarly named), and associated TeX/LaTeX macro files.

Literate programming should not be confused with other aspects of documentation. In particular:

For examples to emulate, see Knuth's programs to read, which includes a literate version of Colossal Cave Adventure if you can imagine such a thing.