From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] Re: Plan9 Programming languages ! -- PASCAL? From: "Russ Cox" MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20011213014122.368FA19A00@mail.cse.psu.edu> Date: Wed, 12 Dec 2001 20:41:17 -0500 Topicbox-Message-UUID: 3483319e-eaca-11e9-9e20-41e7f4b1d025 > The original TeX was written in a language called Web, which tries to > address some of the limitations of standard Pascal. When the Web source is > run through a program called Tangle it generates Pascal source code, and > when run through a program called Weave it generates an allegedly > attractive and easier to follow version of the program, although I > personally find the resultant programs virtually impossible to follow. Suppose you subscribe to the Kernighan & Plauger thesis that programs should be clear. Then the fundamental problem here is that literate programming provides yet another way not to address a lack of clarity in the program. If a program doesn't make sense at first reading, it doesn't need extra text describing it; it needs a good rewrite. Too often, people spend their time documenting a bad program instead of rewriting it into a good program. It's been many years since I looked at Knuth's book, so I'm not claiming this is or is not his problem. However, I've worked with enough literate programs in the past couple years to know that it can be a problem. On the other hand, if you start with a clear program then I think literate programming isn't such a bad way to make it accessible to a larger audience, especially one that isn't experienced in reading code they didn't write. > It's all described in Knuth's book "Literate Programming", and the program > itself can be seen in the book "TeX, The Program". Knuth gave up the Pascal > version some time ago, and now uses a C version called CWeb. This is not true. As Howard said, the Pascal is still very much there, just converted to C as part of the build process. If you don't believe me, try: cd /sys/src/cmd/tex/web2c/tex /sys/lib/texmf/bin/$cputype/tangle tex.web tex.ch sed 20q tex.p Also, quoted from /sys/src/cmd/tex/web2c/doc/web2c.info-1: % "Web2c" is the name of a TeX implementation, originally for Unix, but % now also running under DOS, Amiga, and other operating systems. By "TeX % implementation", we mean all of the standard programs developed by the % Stanford TeX project directed by Donald E. Knuth: Metafont, DVItype, % GFtoDVI, BibTeX, Tangle, etc., as well as TeX itself. Other programs % are also included: DVIcopy, written by Peter Breitenlohner, MetaPost % and its utilities (derived from Metafont), by John Hobby, etc. % % General strategy: Web2c works, as its name implies, by translating the % WEB source in which TeX is written into C source code. Its output is % not self-contained, however; it makes extensive use of many macros and % functions in a library (the `web2c/lib' directory in the sources). % Therefore, it will not work without change on an arbitrary WEB program. % % [...] % % History: Tomas Rokicki originated the TeX-to-C system in 1987, % working from the first change files for TeX under Unix, which were done % primarily by Howard Trickey and Pavel Curtis. Tim Morgan then took over % development and maintenance for a number of years; the name changed to % Web-to-C somewhere in there. In 1990, Karl Berry became the % maintainer. He made many changes to the original sources, and started % using the shorter name Web2c. In 1997, Olaf Weber took over. Dozens of % other people have contributed; their names are listed in the % `ChangeLog' files. Russ