4 ms·
I wholeheartedly agree. To me, Knuth's literate programs feel more incomprehensible than sanely structured programs with few strategically strewn in comments. Y
by aurelian15 9y ago
I wholeheartedly agree. To me, Knuth's literate programs feel more incomprehensible than sanely structured programs with few strategically strewn in comments. Yet to be fair, one has to consider that the Pascal Knuth was working with offered significantly fewer structural elements than modern programming languages, so his meta-programming language WEB helps to mitigate this, as well as given some abstraction over a variety of Pascal implementations. But at the same time it is drowning the source code in prose, which, as the parent comment notes, is not really helpful to the experienced programmer.
As a hobby project I'm currently working on a replacement for web2c, the nightmarish program written in the 1980s that is used to translate the TeX source code -- written in WEB -- to C. And I must admit that I don't really like WEB. It is quite difficult to parse correctly, since the tokenizer to some degree needs to cover TeX, Pascal, and WEB and is not regular (there e.g. are nested comments), and the WEB macro system relies on applying text substitutions and reparsing the entire file until no further substitutions can be applied, which might be nice from a theoretical point of view, but at least from my experience, is quite hard to implement. Even the C preprocessor -- which in my understanding is just a single feed-forward pass -- is sane in comparison to WEB.