3 ms·
Literate programming comes up every so often on HN. Here is a past discussion asking why didn't it catch on, [1]. I like the idea of reproducible reports, the a
by todd8 10y ago
Literate programming comes up every so often on HN. Here is a past discussion asking why didn't it catch on, [1]. I like the idea of reproducible reports, the apparent motivation of the OP, which is a bit different emphasis than literate programming.
[1] https://news.ycombinator.com/item?id=10069748 https://news.ycombinator.com/item?id=10069748
- agravier 10y agoI think that it did catch on, mainly under the form of iPython notebooks.
- todd8 10y agoYes, the iPython notebooks are great for reproducible reports. Literate programming, as practiced by Knuth, is a little bit different. The program's output, graphs, tables, etc. isn't intermixed with the text as it is in a Jupyer notebook. A literate program is actually documentation and source mixed together in a web file. Two different programs (tangle and weave) can be run over this literate code. One extracts a (LaTeX) document suitable for publication and the other extracts a program (with all of the documentation stripped out) to be fed into a compiler. The best example I know of is Computers & Typesetting, Volume B: TeX: The Program [1], a 624 page book that is a complete exposition on the TeX program, generated by weave; the same web source run through tangle generates the TeX program itself (the typesetting program upon which LaTeX is built out of TeX macros). Knuth is a fan of this method of program construction. Of course, he is not only a phenomenal programmer; he is a great writer skilled at explaining complex algorithms and code. I can see why literate programming suits him. [1] https://www.amazon.com/Computers-Typesetting-B-TeX-Program/dp/0201134373/ref=sr_1_7?ie=UTF8&qid=1472702616&sr=8-7&keywords=computers+%26+typesetting https://www.amazon.com/Computers-Typesetting-B-TeX-Program/d...
- crdoconnor 10y agoThe idea of literate code seems much more suited to tests telling a story than it does for regular code.