Donald Knuth was framed
The shell script uses utilities that are written in C, probably totaling way more lines of system programming language code than Knuth&#x27;s Pascal solution.<p>It&#x27;s a pretty unfair comparison, since the literate programming solution was not presented in order to show a code-golfed word histogram, but how to annotate code.<p>The has trie structure was included in it for that purpose, to show how you use literate programming to annotate such a thing.<p>&gt; <i>First of all, we found that Literate Programming as conceived by Knuth not just “text, code, text, code”. </i><p>Unfortunately, it&#x27;s something worse! It&#x27;s a system in which you chop up a program into arbitrary sections, and give these macro-like names. The sections are presented in some aribitrary order and hierarchically combined together using those macro-like names.<p>Like, say:<p><i>The program&#x27;s overall structure is to accept input, performs some processing and produce output:</i><p><pre><code>   accept_input

   do_processing

   produce_output
</code></pre>
The divisions don&#x27;t follow function boundaries. A specific loop inside a specific function might have its own section, and the variable declarations above their own.<p>It&#x27;s basically horrible. You can&#x27;t see the code all in one piece at all when editing it. It won&#x27;t play with your existing tools. The generated result won&#x27;t even have proper indentation.<p>Web and CWeb are programs geared toward someone who is an academic, mainly interested in writing a paper that revolves around a small amount of code.<p>What you&#x27;re really writing is a paper, such that both the typeset paper (with nicely typeset code), and accompanying code pops out from the same source.  The raison d&#x27;etre is that paper though.<p>You would be suicidal to use this to write an actual application that doesn&#x27;t need to be detailed in an academic paper.<p>Knuth did somewhat take it to those extremes, but working alone.<p>If we look at TeX, the bulk of it consists of a single tex.web file which is simultaneously not such a large volume of work (less than 25,000 lines of code of documentation and data, less than a 1024K megabyte) ... yet too large to be all in a single file.