Happy birthday!
Post by Edward McGuireTo celebrate, I'm releasing a simple Literate Programming tutorial
based on the classic C "hello, world" program.
https://metaed.com/papers/hello/
NICE! Welcome to the literate programming world. I think you made the
best choice---NOWEB by Norman Ramsey. It's not that other tools are
inferior, but that Ramsey's LaTeX layout happens to be the most
beautiful one.
Post by Edward McGuireThis is in the nature of a draft. Suggestions are welcome.
I liked the introduction. However, notice that by calling your chunks
as holons, you're eclipsing the name ``chunk'' which seems to be the
understand one. Something to think about.
Also, you begin your program with hello.c---external declarations and
procedure definitions. It's questionable whether this is the best
presentation. This chunk is what the /compiler/ expects to see:
declarations first, then definitions. Is it what humans should see?
Why don't we go straight to the essence of the program and leave the
compiler preferred order for last? You observed that in the NOWEB
section:
--8<-------------------------------------------------------->8---
And they let you organize the sections of the work in the order that
makes sense to the future programmer, instead of in the order that the
programming language constrains you to.
--8<-------------------------------------------------------->8---
So I would say that perhaps the first chunk should be /hello main body/
because that is precisely what we expect from a hello-world.
I see you explain the NOWEB terminology. I wonder if Knuth was the one
who started with the term /chunk/ as well. If so, then I'd advise
against /holon/.
Thanks for keeping this newsgroup alive.
(*) Cosmetics
Your section 2 could use some cosmetic treatment. For instance, the
source code shown should perhaps be separated by a blank line from the
paragraph above.
Your section 5 could be reduced so as to get the section title in a
single line. Perhaps ``a complete program embodied in one file''.
(*) Makefile
More often than not, users don't have NOWEB installed, so they wouldn't
be able to do anything with your program but read it. So I usually
leave the Makefile outside of NOWEB as a stand-alone file and I include
in the package the C source files so that users don't need to have NOWEB
to just compile and run the program.
We could still put the Makefile inside of NOWEB and get it out before
packaging, but I actually like to use the Makefile to detect when make
itself should invoke noweb. In other words, I can prefer to have make
as the main driver.