Keynote Address: the Design of TEX and Metafont: a Retrospective
Total Page:16
File Type:pdf, Size:1020Kb
Keynote Address: The design of TEXandMETAFONT:Aretrospective Nelson H. F. Beebe University of Utah Department of Mathematics, 110 LCB 155 S 1400 E RM 233 Salt Lake City, UT 84112-0090 USA WWW URL: http://www.math.utah.edu/~beebe Telephone: +1 801 581 5254 FAX: +1 801 581 4148 Internet: [email protected], [email protected], [email protected] Abstract This article looks back at the design of TEXandMETAFONT, and analyzes how they were affected by architectures, operating systems, programming languages, and resource limits of the computing world at the time of their creation by a remark- able programmer and human being, Donald E. Knuth. This paper is dedicated to him, with deep gratitude for the continued inspiration and learning that I’ve received from his software, his writing, and our occasional personal encounters over the last 25+ years. 1Contents ter-based analog typesetters had entered the market, and in the view of Donald Knuth, had seriously de- 1Contents 1001 graded quality. When the first page proofs of part of the second edition of Volume 2 arrived, he was so 2Introduction 1001 disappointed that he wrote [35,p.5]: 3 Computers and people 1002 I didn’t know what to do. I had spent 15 years writing those books, but if they were going to 4 The DEC PDP-10 1002 look awful I didn’t want to write any more. How could I be proud of such a product? 5 Resource limits 1004 A few months later, he learned of some new devices that used digital techniques to create letter images, 6 Choosing a programming language 1005 and the close connection to the 0’s and 1’s of com- 7 Switching programming languages 1006 puter science led him to think about how he himself might design systems to place characters on a page, 8 Switching languages, again 1008 and draw the individual characters as a matrix of black and white dots. The sabbatical-year project 9 Wrapping up 1009 produced working prototypes of two software pro- grams for that purpose that were described in the 2Introduction book TEXandMETAFONT: New Directions in Typeset- More than a quarter century has elapsed since Don- ting [32]. ald Knuth took his sabbatical year of 1977–78 at The rest is of course history ... the digital type- Stanford University to tackle the problem of improv- setting project lasted about a decade, produced sev- ing the quality of computer-based typesetting of his eral more books [36, 37, 38, 39, 40, 34, 35], Ph.D. famous book series, The Art of Computer Program- degrees for Frank Liang [44], John Hobby [16], ming [26, 27, 28, 29, 30, 31]. Michael Plass [48], Lynn Ruggles [49], and Ignacio When the first volume appeared in 1968, most Zaballa Salelles [57], and had spinoffs in the com- typesetting was still done by the hot lead process, mercial document-formatting industry and in the and expert human typographers with decades of ex- first laser printers. TEX, and the LATEXsystembuilt perience handled line breaking, page breaking, and on top of it [9, 10, 11, 42, 43, 45], became the stan- page layout. By the mid 1970s, proprietary compu- dard markup and typesetting system in the computer TUGboat, Volume 0 (2001), No. 0 — Proceedings of the 2001 Annual Meeting 1001 Nelson H. F. Beebe science, mathematics, and physics communities, and porting 50–100 interactive login sessions. Its total has been widely used in many other fields. physical memory was just over three megabytes, but The purpose of this article is to look back at TEX we called it three quarters of a megaword. Although and METAFONT and examine how they were shaped computer time was still a chargeable item, we man- by the attitudes and computing environment of the aged to recover costs by getting each Department time. to contribute a yearly portion of the expenses as a flat fee, so most individual users didn’t worry about 3 Computers and people computer charges. Now that computers are widely available through- out much of the developed world, and when embed- 4 The DEC PDP-10 ded systems are counted, are more numerous than The PDP-10 ran at least eight or nine different op- humans, it is probably difficult for younger people to erating systems: imagine a world without computers readily at hand. BBN TENEX, • Yet not so long ago, this was not the case. Compuserve 4S72, • Until the desktop computers of the 1980s, a DEC TOPS-10 (sometimes jokingly called ‘computer’ usually meant a large expensive box, at • BOTTOMS-10 by TOPS-20 users), least as long as an automobile, residing in a climate- DEC TOPS-20 (a modified TENEX affection- controlled machine room with raised flooring, and • ately called TWENEX by some users), fed electricity by power cables as thick as your wrist. MIT ITS (Incompatible Time Sharing System), At many universities, these systems had their own • Stanford WAITS (Westcoast Alternative to buildings, or at least entire building floors, called • ITS), Computer Centers. The hardware usually cost hun- Tymshare A UGUST, a modified TOPS-10, and dreds of thousands to millions of dollars (where ac- • Tymshare TYMCOM-X, and on the smaller cording to the US Consumer Price Index, a million • dollars in 1968 is roughly the same as five million in DECSYSTEM 20/20 model, TYMCOM-XX. 2000), and required a full-time professional staff of Although the operating systems differed, it was usu- managers, systems programmers, and operators. ally possible to move source-code programs among At most computer installations, the costs were them with few if any changes, and some binaries passed on to users in the form of charges, such as compiled on TOPS-10 in 1975 still run just fine on the US$1500 per hour for CPU time and US$0.50 to TOPS-20 today. open a file that I suffered with as a graduate student Our machines at Utah both used TOPS-20, but earning US$1.50 per hour. At my site, there weren’t Donald Knuth’s work on TEXandMETAFONT was any disk storage charges, because it was forbidden done on WAITS. That system was a research op- to store files on disk: they had to reside either on erating system, with frequent changes that resulted punched cards, or magnetic tape. A couple of years in bugs, causing many crashes and much downtime. ago, I came across a bill from the early 1980s for a Don told me earlier this year that the O/S was aptly 200MB disk: the device was the size of a washing named, since he wrote much of the draft of the machine, and cost US$15,000. Today, that amount TEXbook while he was waiting in the Computer Cen- of storage is about fifty thousand times cheaper. ter for WAITS to come back up. I have cited these costs to show that, until desk- For about a decade, PDP-10 computers formed top computers became widespread, it was people the backbone of the Arpanet, which began with who worked for computers, not the reverse. When just five nodes, at the University of California cam- a two-hour run cost as much as your year’s salary, puses at Berkeley, Los Angeles, and Santa Barbara, you had to spend a lot of time thinking about your plus SRI (Stanford Research Institute) and Utah, programs, instead of just running them to see if they and later evolved into the world-wide Internet [13, worked. p. 48]. PDP-10 machines were adopted by major When I came to Utah in 1978, the College of Sci- computer science departments, and hosted or con- ence that I joined had just purchased a DECSYSTEM tributed to many important developments, including 20, a medium-sized timesharing computer based on at least these: the DEC PDP-10 processor, and the Department of Bob Metcalf’s Ethernet [Xerox PARC, Intel, and Computer Science bought one too on the same or- • DEC]; der. Ours ultimately cost about $750,000, and sup- Vinton Cerf’s and Robert Kahn’s development of plied many of the computing needs of the College • the Transmission Control Protocol and the Inter- of Science for more than a dozen years, often sup- net Protocol (TCP/IP); 1002 TUGboat, Volume 0 (2001), No. 0 — Proceedings of the 2001 Annual Meeting Keynote Address: The design of TEXandMETAFONT:Aretrospective the MACSYMA [MIT], REDUCE [Utah] and The KA-10 was one of the early PDP-10 models, so • MAPLE [Waterloo] symbolic-algebra languages; such performance was quite impressive. The high- several dialects of LISP, including MACLISP level BLISS language might have been preferred for • [MIT] and PSL (Portable Standard Lisp) such work, but it was comparatively expensive to li- [Utah]; cense, and few sites had it. Anyway, Ralph Gorin’s book on assembly language and systems program- the systems-programming language BLISS ming [12] provided an outstanding resource for pro- • [DEC and Carnegie-Mellon University (CMU)]; grammers. the shell-scripting language PCL (Program- • Document formatting was provided by RUNOFF mable Command Language) [DEC and CMU]; which shared a common ancestor ROFF with UNIX the SAIL (Stanford Artificial Intelligence Lan- TROFF.Later,SCRIBE became available, but required • guage) Algol-family programming language in an annual license fee, and ran only on the PDP-10, which TEXandMETAFONT were first imple- so it too had limited availability, and I refused to use mented; it for that reason. an excellent compiler for PASCAL [Hamburg/ The PDP-10 had 36-bit words, with five seven- • Rutgers/Sandia], the language in which TEX bit ASCII characters stored in each word.