knuth-literate-programs icon indicating copy to clipboard operation
knuth-literate-programs copied to clipboard

Examples of literate programming by Knuth

This contains typeset versions (i.e. passed through cweave) of programs written by Knuth, mainly for himself, available at https://cs.stanford.edu/~knuth/programs.html

Collected here for those who are too lazy to install CWEB and run cweave, and who would otherwise attempt to read the .w files directly instead of reading them the way they are intended to be. :-)

This repository is a mess and I should clean it up sometime; but in the meantime the programs (as of 2017 or something) are available here: https://github.com/shreevatsa/knuth-literate-programs/tree/master/programs (TODO: Add some words about the conventions of CWEB or link to its manual.)

Edit: See also https://github.com/ascherer/cwebtest which is more up-to-date w.r.t. the programs: it has a runall.sh which you can use to generate the .tex files and then get PDFs out of them. Maybe I should change this repository to just use that. Some day…