News for hackers. Stuff that matters.
Re:Literate Programming: Articles by smcl on Thursday May 18, 2023 @04:16AM (#35985269)
That's ... a lot of articles. Is there any article in particular worth checking out?
Re:Literate Programming: Articles by alex_muscar on Thursday May 18, 2023 @05:16AM (#35985709)
Knuth's original article is a good starting point: http://literateprogramming.com/knuthweb.pdf.

Knuth's Programming Pearls entries are good reading as well.

Re:Literate Programming: Articles by smcl on Thursday May 18, 2023 @06:04AM (#35985988)
Yeah I have read the original Literate Programming text and played with tangle/weave a bit before realising jupyter notebooks were more suitable for what I was doing. I'm just wondering if there is something in particular the submitter wanted to highlight, or whether they just wanted to share the concept of "Literate Programming" in general
Re:Literate Programming: Articles by everybodyknows on Thursday May 18, 2023 @10:31AM (#35988494)
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

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.

Re:Literate Programming: Articles by smcl on Thursday May 18, 2023 @11:53AM (#35989773)
I 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/[email protected]) 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 - you'll see what I mean.