![]() |
|
This book is the first in aseries of eight volumesthat contain archival forms of my published papers,together with new material.
Literate programmingis a methodology that combines a programming languagewith a documentation language, thereby making programs more robust, moreportable, more easily maintained, and arguably more fun to write thanprograms that are written only in a high-level language.The main idea is to treat a program as a piece of literature, addressedto human beingsrather than to a computer. The program is also viewed as a hypertextdocument, rather like the World Wide Web. (Indeed, I used the word WEBfor this purpose long before CERN grabbed it!)This book is an anthology of essays including my early papers on relatedtopics such as structured programming, as well as the article inThe Computer Journal that launched Literate Programmingitself. The articles have been revised, extended, and brought up to date.
Table of Contents:
(Numbers like P68 and Q78 in this list refer to the corresponding papers in mylist of publications.)
Available from the publisher(CSLI),and also from the distributor(University of Chicago Press).
This book received the Productivity Award fromComputer Language magazine,1992, awarded to products that significantly increase programmer productivity.

Quick introduction to literate programming by Chris Lee

For a list of corrections to errors in the first printing of this book,you may download either theerrata file in plain TeX format (8812 bytes)or theerrata file in DVI format (10816 bytes)or theerrata file in compressed PostScript format(34478 bytes);the latter files were generated by the TeX file, and last updated12 Jun 2004. Most of the errors inthe first two printings were corrected in the third printing,but several minor and not-so-minor errors have been found by sharp-eyed readersof the fourth printing (1998) or the fifth printing (2008)or the sixth printing (2013):
- page xiii, line 8
- change 'Eisenstadt' to 'Eisenstat'
- page 4, lines 15 thru 17 from the bottom
- change '1784' to '1794', 'mineralogy' to 'Mineralogy', 'Art' to 'art', and 'Science' to 'science'
- page 15, append to reference [17]
- Second edition, with considerable improvements and additions,1 (1794), xi.
- page 17, line 7
- change "and I'll go mine" to "(and I'll go mine)"
- page 19, line 11
- change '1904' to '1903'
- page 22, line 22
- change 'statement turned out' to 'statements turned out'
- page 26, line 8 from the bottom
- change '+6' to '+1'
- page 26, line 5 from the bottom
- change '11n+21' to '12n+19'
- page 26, line 2 from the bottom
- change '21%' to '14%'
- page 30, line 8
- change '[38, p. 18]' to '[38, pp. 339–341]'
- page 37, line 2 of Example 5
- change 'A[i] <x' to 'x <A[i]'
- page 39, line 14 from the bottom
- change 'Eisenstadt' to 'Eisenstat' (twice)
- page 40, line 3 of Example 5a
- change 'A[i] <x' to 'x <A[i]'
- page 42, line 3 of Example 5b
- change 'A[i] <x' to 'x <A[i]'
- page 42, last five lines of Example 5b
- these lines are all indented by one notch too many
- page 42, line 2 of Example 5c
- change 'A[i] <x' to 'x <A[i]'
- page 43, line 20
- change 'A[i] <x' to 'x <A[i]'
- page 44, line 5
- change 'step 1 until' to 'step 1until'
page 44, line 29- change 'i=' to 'i ='
- page 45, line 5 from the bottom
- change 'exit, jumpout, break, or leave' to 'exit,jumpout,break, orleave'
- page 46, line 1
- change 'Eisenstadt' to 'Eisenstat'
- page 47, line 13 from the bottom
- change 'a repeat loop' to 'arepeat loop'
- page 50, line 7
- change 'repeat:' to 'repeat;'
- pages 51, 52, 53, 53, 56, 57
- change 'integert;valuet;' to 'valuet;integert;'
- page 57, line 11 from the bottom
- change '$n>0$' to '$n\ge0$'
- page 58, line 5
- change 'average, will' to 'average will'
- page 60, lines 3, 4, 5
- change 'all the elements ... greater thanv' to'only elements that are less than or equal to some given valuev;the right partA[j+1]...A[n] will containonly elements that are greater than or equal tov'
- page 67, line 11
- change 'j;' to 'j:'
- page 67, line 14
- change '1;' to '1fi;'
- page 67, line 3 from the bottom
- change 'Hoare' to 'Hoare [13]'
- page 74, line 24
- change 'j;' to 'j:'
- page 80, replace the bottom line by 6 lines
- not found: $m\gets\r1$ 2 $a$
$\r4\gets1$ 1 $a$
toupdate$ 1 $a$
found: $\r4\gets B[\r1]$ 2 $1-a$
$\r4\gets\r4+1$ 1 $1-a$
update: $B[\r1]\gets\r4$ 2 1- page 82, in reference [1]
- changego to to ‘go to’ andwhile to ‘while’ (including those single-quote marks)
- page 83, in reference [22]
- change '9,9 (September 1968)' to '8,9 (September 1965)'
- page 84, line 3
- changeBlonde on blonde toBlonde on Blonde
- page 84, line 4
- change 'March 1966' to 'June 1966'
- page 84, reference [40]
- change 'systems' to 'Systems' and '(1972)' to '(1974)'
- page 85, in reference [46]
- change 'nerve nets' to "nerve nets and finite automata'; also change '3–40' to '3–41'
- page 86, line 10
- change 'Eisenstadt' to 'Eisenstat'
- page 88, reference [93]
- change '17,11' to '18,11'
- page 92, line 20
- change '$\ne\{x_1,\ldots,x_k\}$ which have' to '$\notin\{x_1,\ldots,x_k}$ that have'
- page 92, line 10 from the bottom
- change 'integerk;valuek;' to 'valuek;integerk;'
- page 93, line 18 from the bottom
- change $q=y_{r-1},y_{r-2},\ldots,y_1$ to $q=y_{r-1}$, $y_{r-2}$, \dots, $y_1$
- page 94, line 11
- change '[1 :n]' to '[0 :n]' (twice)
- page 135, reference [3]
- change 'systems' to 'Systems' and '(1972)' to '(1974)'
- page 135, reference [10]
- this reference should be the same as [61] on page 86
- page 159, line 14
- add the statement 'count[0] ← 0;' (to agree with page 164)
- page 195, between sections 111 and 117
- insert an ellipsis (three vertical dots) as between sections 16 and 95 on page 186
- page 250, line 4 from the bottom
- change 'decided not be' to 'decided not to be'
- page 276, line 6 from the bottom
- change 'class L' to 'class L or class R'
- page 279, lines 7 and 12
- change 'FIFO' to 'LIFO'
- page 280, line 13 from the bottom
- change '97' to '65'
- page 287, line 2 before the footnotes
- changez toZ (thrice)
- page 288, line 2 from the bottom
- change $\theta_2$ to $\theta_0$
- pages 294--338
- (Several entries in this log have been edited for consistency of style with respect to the others)
- page 349, lines 9 and 10
- change 'Praktis- che' to 'Prak- tische'
- page 352, line 11
- change '88–94' to '87–94'
- page 354, line 5
- omit 'and David R. Fuchs'
- page 354, line 12
- change 'April 1989' to 'May 1989'
- page 354, line 8 from the bottom
- change 'labrea' to 'ftp.cs'
- page 355, line 12
- change 'labrea' to 'ftp.cs'
- page 358, new item for the bibliography
- Klaus Thull, ``The virtual memory management of PubliC \TeX,''{\sl TUGboat\/ \bf10},1 (April 1989), 15--22.
- page 259, right column
- change 'artificial intelligence, 4.' to `artificial intelligence, 5.'
- page 361, left column
- change 'Macdonald' to 'MacDonald' in the Coxeter entry
- page 361, left column
- change 'x' to 'xii' in theCWEB entry
- page 361, right column
- change 'Eisenstadt, Stanley C.' to 'Eisenstat, Stanley Charles'
- page 362, left column
- Guth, Alan Harvey, 337.
- page 362, right column
- change 'Nicolass' to 'Nicolaas' in the Habermann entry
- page 363, right column
- add page 322 to the references for Frank Liang
- page 364, left column
- change 'Marneffe, Pierre-Arnoul de' to 'Marneffe, Pierre-ArnoulFrédéric Guy Donat de'
- page 365, right column
- change 'Range checks, 30.' to 'Range checks, 30, 32, 59.'
- page 366, left column
- change 'Rustin, Randall' to 'Rustin, Randall Dennis'
- page 366, left column
- Scherlis, William Louis, 322.
- page 367, left column
- change 'Thull, Klaus, 357.' to 'Thull, Klaus, 358.'
- page 368, left column
- change '139' to 'xii, 139' in theWEB entry
Furthermore, several errors were unfortunately introduced onthecover of the 2013 printing:deer should bedecr,and several other elements of the copy should be either italicizedor taken out of italics.
I hope the 2013 version is otherwise error-free. But (sigh) itprobably isn't. Therefore I will gratefully deposit0x$1.00 ($2.56)to the account of the first personwho finds and reports anything that remains technically, historically,typographically, or politically incorrect. Please send suggested corrections toknuth-bug@cs.stanford.edu, or send snail mail toProf. D. Knuth, Computer Science Department, CoDa Building room W208,Stanford University, Stanford, CA 94305-5008 USA.In either case please include your postal address, so that I canmail an official certificate of deposit as a token of thanks for anyimprovements to which you have contributed.
I may not be able toread your message until many months have gone by, because I'm workingintensively onThe Art of Computer Programming. However,I promise to reply in due time.
DO NOT SEND EMAIL TO KNUTH-BUG EXCEPT TO REPORT ERRORS IN BOOKS!And if you do report an error via email, pleasedo notinclude attachments of any kind; your message should bereadable on brand-X operating systems for all values of X.

Don Knuth's home page
Don Knuth's other books