Re: language design tradeoffs

plyon@emx.cc.utexas.edu (Paul Lyon)
Sat, 26 Sep 1992 03:30:17 GMT

          From comp.compilers

Related articles
[34 earlier articles]
Re: language design tradeoffs jlg@cochiti.lanl.gov (1992-09-23)
Re: language design tradeoffs bromage@mullauna.cs.mu.OZ.AU (1992-09-24)
Re: language design tradeoffs alvin@eyepoint.com (1992-09-24)
Re: language design tradeoffs rob@hoster.eng.ohio-state.edu (1992-09-24)
Re: language design tradeoffs chased@rbbb.Eng.Sun.COM (1992-09-25)
Re: language design tradeoffs os360051@wvnvms.wvnet.edu (1992-09-26)
Re: language design tradeoffs plyon@emx.cc.utexas.edu (1992-09-26)
| List of all articles for this month |
Newsgroups: comp.compilers
From: plyon@emx.cc.utexas.edu (Paul Lyon)
Organization: The University of Texas at Austin
Date: Sat, 26 Sep 1992 03:30:17 GMT
Keywords: syntax, design, FTP, comment
References: 92-09-048 92-09-123
Posted-Date: 26 Sep 92 03:30:17 GMT

eifrig@beanworld.cs.jhu.edu (Jonathan Eifrig) writes:
> There's no _a_priori_ reason to expect programs to read like novels.


Literate programming fans might disagree :-). And, after all, the concept
has impeccable parentage (Donald Knuth).


Since matters WEB-ish have been broached several times in this thread, I
surmise there is some interest in literate programming systems. There is
a fairly complete collection of such on niord.shsu.edu: the original WEB,
Cweb, fweb, spiderweb, funnelweb, and so on.


In the ~ftp/litprog directory on niord, there is a bibliography on
Literate Programming, as well as a collection of posts to date for the
``litprog'' mailing list, and instructions on how to subscribe. [I did so
several months ago, but have, alas, forgotten the instructions; if there
is interest from those without ftp access, I will retrieve same and do a
follow-up post.]


Very briefly, the original concept of literate programming precisely _was_
to write a program like a book; in Knuth's case, two: _TeX: the Program_
and _Metafont: the Program_. One writes source files containing both code
and documentation; the tangle processor extracts the source code for
compilation, the weave processor prepares a TeX input file. The original
WEB was language-specific (PASCAL), as are Cweb (K&R C), and fweb (FORTRAN
with a built-in version of ratfor, but now also C and C++). Spiderweb is
adaptable to various languages; it comes with a large awk script to read a
file specifying a pretty- printing grammar for the target language which
is then converted to C for inclusion in the code for the tangle and weave
processors. Grammar files for awk, Ada, C, and C++ are included. Finally,
funnelweb is fully language-independent, but at the price of abandoning
pretty-printing the code: the instructions to TeX are typewriter font and
verbatim formatting for the code; one may, as with the others, use
whatever is compatible with plain TeX in the documentation sections.


Besides the support for better internal documentation and more attractive
hard copy, the chief advantage to the programmer is the capability to
write in something more akin to pseudo-code, substituting descriptive
names of code sections for blocks of code where these are to appear, and
putting the actual code for the block, together with commentary, where it
may seem best. The language specific weave processors also generate an
index of code sections and identifiers at the end of the TeX input file.


Paul Lyon
[To subscribe, mail SUBSCRIBE LITPROG "Your Real Name in Quotes" to
LISTSERV@SHSU.edu. -John]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.