2 ms·
Clicking through the links I find this: > In general, literate programs combine source and documentation in a single file. Literate programming tools then pars
by everybodyknows 3y ago
Clicking through the links I find this:
> In general, literate programs combine source and documentation in a single file. Literate programming tools then parse the file to produce either readable documentation or compilable source.
http://literateprogramming.com/lpfaq.pdf#page11 http://literateprogramming.com/lpfaq.pdf#page11
By this litmus test, the Go standard library qualifies as literate programming. Document production tools are go doc or godoc. The .go files are themselves already compilable source.
- smcl 3y agoI don't think this is quite the same thing. It's nice that godoc autogenerates documentation on the functions + types each module in the stdlib provides (like here: https://pkg.go.dev/compress/bzip2@go1.20.4 https://pkg.go.dev/compress/bzip2@go1.20.4) but it doesn't look like it goes any further. In LP you'd get explanation of the implementation details interspersed with little chunks of code, it wouldn't necessarily be in the same order as the final file would be (just the order it makes sense to see it in). It might be worth checking through the PDF the sister comment to yours linked - http://literateprogramming.com/knuthweb.pdf http://literateprogramming.com/knuthweb.pdf - you'll see what I mean.