19 ms·
Donald Knuth – The Patron Saint of Yak Shaves (2017)
- lstamour 5y agoStill a fun read. Previous HN comments (from a submission a few years back): https://news.ycombinator.com/item?id=15733381 https://news.ycombinator.com/item?id=15733381
- IThoughtYouGNU 5y agoSometimes being a pioneer means you have to shave a few yaks
- zquestz 5y agoEnjoyable read for sure. Must have missed this the first time it went around.
- drfuchs 5y agoThis and more. The Sail version of TeX is mentioned, but everything else had a usable prototype, too: An early version of Metafont in Sail, an early version of Web (called Doc, though I don’t recall what the names of the Tangle and Weave equivalents were), and an early version of Computer Modern fonts in the early Metafont language. Though fully documented and available via anonymous FTP on the Arpanet, all of these prototypes were experimental proofs-of-concept and were completely discarded, along with the languages they implemented, with the “real” versions rewritten from scratch by Knuth (each first by hand on legal pads, then typed in and debugged as a whole.) And you missed one more obscure but instructive example: To get the camera-ready copy for ACP Vol 2, Knuth purchased an Alphatype CRS phototypesetter. And, unhappy with the manufacturer’s firmware, he rewrote the 8080 code that drives the thing. Eight simultaneous levels of interrupts coming from various subsystem: the horizontal and vertical step-motors that you had to accelerate just right, while keeping synchronized with four S100 boards that generated slices of each character in realtime from a proprietary outline format, to be flashed into the lens just as it was passing the right spot on the photo paper. (Four identical boards, since you had to fill the second while the first one did its processing; times two for two characters that might overlap due to kerning). Oh, and you had to handle memory management of the font character data since there wasn’t enough RAM for even one job’s worth (see our joint paper). Fun times. I did the driver on the mainframe side, so got to be there for the intense debugging sessions that used only the CRS’s 4x4 hex keypad and 12-character dot-matrix display. Thanks for the DVI shout-out, btw.
- jacklizhui 5y agoTAOCP vs ACP. Would Knuth approve?
- drfuchs 5y agoHey, on the Sail machine, user names were 3 letters, and you only got one level of subdirectory, also 3 letters long. So, in the syntax of the time, “[ACP,DEK]” was it! (Six bits for each upper-case alphanumeric character means a 6-character directory name neatly fits into a 36-bit word on the DEC PDP-10. And file names were limited to 6 characters for the same reason; extensions were 3 characters, with the remaining 18 bits for file meta-data, I think.)
- gjvc 5y agoNot only is this staggering to think about in terms of the Herculean effort required, but what's even more amazing is the quality of the finished output of the system, unmatched to this day.
- jhgb 5y agoAt least systems were smaller then and much better documented, so the effort was at least well supported. Perhaps the quality is correlated with that since you weren't able to squeeze quantity into your work anyway, so your efforts had to go into quality.
- GiovanniP 5y ago> what's even more amazing is the quality of the finished output of the system, unmatched to this day. If you are referring to the output of TeX, according to Joris van der Hoeven it is matched and surpassed by TeXmacs
- gjvc 5y agoThanks for the DVI shout-out, btw. Thank you for creating it! Is there some article or something which talks about the original project or motivation for the DVI format? If DEK implemented it as part of TeX in 1982, what was DVI being used for before that? (For those unfamiliar, https://en.wikipedia.org/wiki/Device_independent_file_format https://en.wikipedia.org/wiki/Device_independent_file_format)
- rcarmo 5y ago“It’s just that the yak happened to stand close.” I’m still giggling at this one. Amazing write-up.
- xwdv 5y agoSome Buddhists who are vegetarian will justify eating Yaks because one yak can provide food for many people and only requires one life to be lost, as opposed to chickens or fish. The same can be true for computer science.
- lifeisstillgood 5y agoCan you get good eating off a computer scientist? I have seen of the scrawnier ones in labs, they probably would only feed one or two people so I am not sure the utilitarian approach is a winner ? Maybe if we fed them a diet of Mountain Dew and Pizza it might improve the flavours?
- bloopernova 5y agoIt's largely due to the relatively low effort required to hunt and catch one. Less energy spent means it's economical to hunt the scrawny ones. You could spend a couple of days chasing down the larger specimens, but they tend to put up more of a struggle, and in the time spent, you could have a dozen scrawny engineers already in your larder or stew.
- lifeisstillgood 5y agoThis is of course similar to how early human hunters operated - simply chasing down the prey till they fell exhausted. For the average post-doc CS student this will be three to four blocks so the energy trade off is in your favour. However the available calories drops significantly with cryptographers and even though you can drop one after just one block the energy trade off is even. Fascinating discussion :-)
- hereforphone 5y agoDonald Knuth is a Christian and is known for shaving yaks. Don't know if he likes eating them too.
- yannis 5y agoIt is an entertaining article, but I am not too sure if I agree that Knuth was yak shaving. However by luck, inspiration, conviction or observation he understood what makes a program last. You focus on one thing and you do it well. On the way you resolve all the problems. He famously said that at first he had one user: himself but then things were different when he had 1000 users. At that stage you need to remove bugs and hence his famous checks rewarding people that reported bugs. When your user base grows allow them to extend the program through their own code. I also think that the program adapted well, throughout the four decades of its usage due to the well thought level of abstraction. Nearing my three score and ten years, and using TeX/LaTeX for all these decades, I can with confidence state, that the only people yak shaving was us all the early adopters, learning typography rather than focusing on our studies. The same can of course be said for current users.
- lifeisstillgood 5y agoAs someone only on their two score and ten, (and many bald yaks behind me) do you have advice for keeping on writing code as opposed to the horrors of management ?
- jacquesm 5y agoStay out of the hierarchy and start consulting, specifically troubleshooting. The rates are higher because the clients need to get stuff done and a lot of red tape will be cut for you by people in a position to make decisions. Also: your customers will be genuinely happy. Then: leave. Don't hang around because you'll become part of the problem, no matter how much they offer. Increase your price by 25% every year or so, until you start losing customers, and ask your previous customers if you can use them as a reference.
- lifeisstillgood 5y agoI like it :-)
- jacquesm 5y ago
- graycat 5y ago> TeX is also not a programming language. I wrote some macros in TeX, over 100 of them, and in them used programming language constructs including if-then-else, do-while, dynamically allocated typed variables, and file reading and writing. Sounds like a "programming language" to me. Sorry, TeX was not written primarily for programmers or computer scientists. Instead the target audience was people who use a lot of mathematical notation. In my opinion, the main glory of TeX is how it helps position the mathematical symbols in mathematical expressions, including some really complicated ones. I know a guy, a good mathematician, who had a really tough time understanding the purpose of TeX. He kept evaluating TeX in terms of what it did for the future of word processing taken very generally, maybe all the way to video as in some Hollywood movies. E.g., TeX is not promising for generating video of a Darth Vader light saber battle. Then he noticed that TeX is not really that future. I finally explained to him that TeX was not trying to be the future of some generalized word processing, thus, was not looking ahead, and instead was looking back and at something he knew well -- the literature of advanced math as in math journals such as published by the AMS (American Mathematical Society or some such). So, TeX was to ease the word processing needed for pages of mathematics as in the math journals and textbooks. That friend kept asking me to write a converter that would convert a file of TeX to a file of HTML. I kept telling him that such a converter was impossible because TeX was a programming language and HTML was not. I did explain that at least in principle could write a converter to convert TeX output, that is, a DVI (device independent) file to HTML. There are converters, heavily used, to convert DVI to PDF (portable document format or some such). I like TeX; it is one of my favorite things, and I use it for all my higher quality word processing, the core, original math for my startup, business cards, even business letters. My last published paper (in some mathematical statistics) was in TeX, and using TeX was liberating because I could just go ahead and do the math and not worry about how I was going to get the word processing done, did not have to bend the math and reduce the content to make the word processing easier. Future of TeX? The fraction of the population that wants to typeset complicated math expressions seems to be tiny, and there are lots of alternatives for others. So, my guess is that TeX will be like, say, a violin -- won't change much in hundreds of years. The OP mentioned LaTeX: For people new to TeX, no, you don't have to learn LaTeX. The approach of LaTeX is different. In an analogy, LaTeX wants you to state if you are building a bicycle, motorcycle, car, truck, boat, or airplane, and then lots of lower level details are handled for you. With TeX, never decide what vehicle type are building and, instead, work with the parts and pieces -- yes, with a lot of help. There is Knuth's book on TeX, The TeXbook, and also the books on LaTeX. In comparison, Knuth's book is a lot shorter than the books on LaTeX. So, I got the books on LaTeX, looked at them, and decided that it was easier just to stay with TeX and the macros I could write for TeX. So, for people new to TeX, don't really have to get and read the books on LaTeX. Getting math typeset was a big problem. TeX is a good solution. Problem solved. We can move on! The collection of TeX macros I wrote has over 100 macros
- no-such-address 5y agoWasn't DEK giving a talk entitled, "The Letter S" in connection with the invention of Metafont? Nothing but admiration!
- tephra 5y agoHe wrote a whole paper on it! Sadly it is behind paywalls.
- hcs 5y agoI happened to be reading John Wilkins' introduction to "An Essay Towards A Real Character and a Philosophical Language" [1] yesterday, he mentions that Messalla Corvinus wrote a treatise on the letter S, though it seems we only have the title, "Liber de S. Lit[t]era" [2]. I wonder if Knuth had this in mind. [1] https://archive.org/details/AnEssayTowardsARealCharacterAndAPhilosophicalLanguage/page/n18/mode/1up https://archive.org/details/AnEssayTowardsARealCharacterAndA... , last paragraph, he also mentions other books on letters and parts of letters. [2] http://www.perseus.tufts.edu/hopper/text?doc=Perseus:text:1999.04.0104:entry=messalla-bio-9 http://www.perseus.tufts.edu/hopper/text?doc=Perseus:text:19...
- davidgerard 5y agoI dunno, that time Ken and Dennis wanted to port their video game so they wrote a small operating system. How did that OS end up going?
- qntty 5y agoThe Art of Computer Programming itself is a yak shave. Knuth was originally going to write a book on compilers, but he realized that he needed to cover some prerequisites first, and that became TAOCP.
- znpy 5y agoUnironically, I hope thst compiler book sees the life one day. Iirc that should be part of the taocp plan.
- hcs 5y ago"Volume 5 Syntactic Algorithms, in preparation. 9. Lexical scanning (includes also string search and data compression) 10. Parsing techniques ... And after Volumes 1--5 are done, God willing, I plan to publish Volume 6 (the theory of context-free languages) and Volume 7 (Compiler techniques), but only if the things I want to say about those topics are still relevant and still haven't been said." https://www-cs-faculty.stanford.edu/~knuth/taocp.html https://www-cs-faculty.stanford.edu/~knuth/taocp.html
- MarcusE1W 5y agoDoes that mean TeX and ACP delayed the revelation of thoughts about compiler technics by 40 years and he thinks his original thoughts to start the whole thing with are still relevant and at least partially not published/discovered? Given what he did for computer algorithms (and doc type setting) this makes me really curious about his views on compilers.
- hcs 5y agoHe's been publishing in the space all the while [1], I'm guessing a lot of what he still has unpublished is in terms of how to present and connect across the ever growing literature. [1] https://www-cs-faculty.stanford.edu/~knuth/cl.html https://www-cs-faculty.stanford.edu/~knuth/cl.html
- projektfu 5y agoI think, though, that there was nothing preventing him from developing TeX in Fortran or something, and leaving it at that. He is just somewhat easily distracted. He nerd-snipes himself possibly. Yak Shaving is the frustrating work we do because of impedance mismatch in the system. Libtool is a huge yak shave, for example. But so is writing a custom CSV parser because an input file is just not quite accessible by the standard, and you could just use python to make the translation, but your environment won't let you use python in that spot, etc. Days later nothing is really accomplished, you hate programming, and you can finally start work on the real problem after losing the motivation you had when you started. But I like the idea of a patron saint for this, and Knuth is as good as any. Perhaps Dijkstra could be the patron saint of Unused Better Solutions. I'm sure there's a litany of things that could use saints in this field.
- chubot 5y agoHm what unused better software did Djikstra write? Maybe Knuth could have used Fortran and not Pascal, but that doesn’t solve the literate programming problem ... he would still want something like WEB. Seems like Fortran is more maintained today than Pascal, but Knuth couldn’t have known that. The community yak shave to translate the code arose out of other forces in the industry.
- bombcar 5y agoPascal was a huge force in the computing world for quite awhile - Turbo Pascal on the IBM PC was by far and away perhaps the most performant programming environment available.
- projektfu 5y agoRight, I'm saying he didn't really need to solve the literate programming problem if he was really focusing on writing a book on algorithms that was to precede his book on compilers. That's alright, the journey is often more important than the destination. He wanted to tell the story of writing TeX in a book in which TeX is written, and it made sense to intercalate the text and the program. There just wasn't a tool that could do anything with it yet.
- civilized 5y agoThere's a certain kind of computer science paper from the 90s, very frequently encountered if you're familiar with the research. The typesetting is incredibly ugly, and they're all ugly in the same characteristic way. See for example [1] (just the first one I found, some are quite a bit worse). I want to know the story behind this. In the case of my example, note that when you load this paper in a browser, the tab will say "main.dvi". So I'm guessing the paper was typeset in LaTeX, published as DVI, and when PDF came along they converted it, but the DVI -> PDF conversion algorithm was really bad. [1] https://courses.cs.duke.edu/spring02/cps296.1/papers/H-SIGMOD1999.pdf https://courses.cs.duke.edu/spring02/cps296.1/papers/H-SIGMO...
- knuthsat 5y agoThis is computer modern optimized for printing. It’s not bad, the pixels are constructing the glyphs in a way that makes them good for printing. Bitmap version of the font, I guess.
- gkbfj 5y agoDVI files do not contain fonts. What happened here is that the DVI to PDF conversion targeted a low resolution bitmap output (for screen/download, not for printing). The vector font specified by the DVI file was rasterized at that point. Later, PDF compatible (PostScript) vector versions of the Computer Modern fonts became available. https://wearables.cc.gatech.edu/resources/latex2pdf.html https://wearables.cc.gatech.edu/resources/latex2pdf.html
- mwcampbell 5y agoThere are also some old papers, converted to PDF by way of dvips and Ghostscript, that are completely unreadable with a screen reader unless you OCR them, because the text in the PDF is somehow not using Unicode or even ASCII. You'll see the same problem if you run pdftotext or similar on the document. My usual example is this: https://legacy.cs.indiana.edu/~dfried/mex.pdf https://legacy.cs.indiana.edu/~dfried/mex.pdf (I only know about this paper because someone linked to it on HN several years ago.) I'd be interested to know more about how the conversion to PDF ended up like this.
- amelius 5y ago> But “The Art of Computer Programming” is an impressive book in its own right: it is still unfinished, currently spanning 3.5 volumes (yes, the fourth is unfinished, but the first chapters are released). I wish he would update his volume on Searching and Sorting with modern search engine techniques.
- taeric 5y agoI'm curious on the updates you anticipate. Many of the items in the book are approachable without having to go too far into specific domains.
- amelius 5y agoThe most important chapter would be on how to benchmark a search engine. And I would expect coverage of NLP techniques. Of course, a search engine makes use of distributed computing techniques, so I'd also expect a volume on that topic :)
- taeric 5y agoMy gut would be that his benchmark would be highly focused on number of memory access. And heavily empirical. Agreed that it would be neat to see.
- kamranjon 5y agoI follow the folks over at 100 rabbits (https://100r.co https://100r.co) and I think they’ve sort of developed yak shaving into a lifestyle. I don’t want to go too far into it cause the website is a treasure trove and exciting to explore on your own but if you follow some of their latest stuff, they’ve built a stack based virtual machine, and a whole set of software around it and it truly feels like they are just exploring every avenue that interests them without rushing themselves. Truly the embodiment of my grow a beard and learn Haskell dreams.
- Alekhine 5y agoI'm learning Haskell right now with a textbook and the help of some friends. Would you like to join us?
- wodenokoto 5y agoAfter googling around, as far as I can tell the word yak shaving come from a ren and stimpy cartoon episode from the early nineteens. But how did it go from preparing for yaksmas to the current meaning?
- bellyfullofbac 5y agoProbably because some hacker started using it, according to the Jargon File[1] someone in the MIT AI Lab popularized it. [1] http://www.catb.org/jargon/html/Y/yak-shaving.html http://www.catb.org/jargon/html/Y/yak-shaving.html
- kragen 5y agoI don't think that's in AI-lab versions of the Jargon File.
- PaulDavisThe1st 5y agoGranted, there is a substantial degree to which font design has a strong subjective element (even though there are some non-subjective metrics that must be met too). However, the font that emerged in "Yak shave #4", Computer Modern, manages (for me) to pull off a somewhat exceptional double feat. On the one hand, it is to my eyes one of the ugliest fonts designed during the 20th century; on the other, my experience of it as a reader (hence again, my eyes) is that it is one of the easiest to read fonts ever created. I assume that DK found CM to be both beautiful and readable, which is fine, but I think it's even more remarkable that he could have created a font that someone with a modicum of interest in font design and typesetting could find both ugly and very readable.
- taeric 5y agoI'm intrigued. Typically ugly things are jarring and slow down interaction. Can you elaborate on what makes it easy to read?
- nextos 5y agoIf you go through old Springer Undergraduate or Graduate Texts in Mathematics (typeset in TeX and Computer Modern) you'll notice they are really pleasant on the eyes. The amount of information density is just right. There's no noise and it's very easy to distinguish where sections start and end. If you look into any great pre-TeX book like Rudin [1], it looks much uglier and more difficult to read. I'd actually pay a significant amount of money for new editions of Rudin or Halmos typeset in TeX and Computer Modern. They'd be much easier to go through. I must also add Latin Modern is a slight update to Computer Modern that is slightly thicker and looks much better on screens. [1] https://web.math.ucsb.edu/~agboola/teaching/2021/winter/122A/rudin.pdf https://web.math.ucsb.edu/~agboola/teaching/2021/winter/122A...
- taeric 5y agoRight. My question was more surprise that easy to read does not translate to beautiful in this case. Seems an odd juxtaposition. Caveat, I like computer modern.
- thepete2 5y agoBesides Tex there is also git. Written only as a SCM for the linux kernel it went on to be used basically anywhere.
- happycube 5y agoWhen I saw Microsoft put the Windows source tree into git, I figured "ok, that's it, git won."
- mathattack 5y agoFrom his point of view, this certainly seems like a continuation of a life passion. Wouldn’t we all just love to follow our curiosity? Highlights a life well lived. I’m curious on if this helped or hindered AoCP? Did it improve the work because the great theorist is also practicing on the side? Or did it slow down creation of AoCP? If the answer is “both”, which effect is stronger? This is written with all due respect to this great polymath.
- bombcar 5y agoI suspect it helped, because it gave him “full stack control” and never did he have to be pissed at the output and have to rework everything (instead he could just fix what was wrong). Being in total control of your tooling is very nice for work that will span decades.
- chubot 5y agoGreat post! I just dug up this informative comment by @svat from 3 years ago on the Pascal to C conversion, for anyone who's interested: https://news.ycombinator.com/item?id=16526151 https://news.ycombinator.com/item?id=16526151 Today, major TeX distributions have their own Pascal(WEB)-to-C converters, written specifically for the TeX (and METAFONT) program. For example, TeX Live uses web2c[5], MiKTeX uses its own “C4P”[6], and even the more obscure distributions like KerTeX[7] have their own WEB/Pascal-to-C translators. One interesting project is web2w[8,9], which translates the TeX program from WEB (the Pascal-based literate programming system) to CWEB (the C-based literate programming system). The only exception I'm aware of (that does not translate WEB or Pascal to C) is the TeX-GPC distribution [10,11,12], which makes only the changes needed to get the TeX program running with a modern Pascal compiler (GPC, GNU Pascal). ... I may write a blog post on this since it's relevant to how https://www.oilshell.org/ https://www.oilshell.org/ is written in a set of Python-based DSLs and translated to C++.
- thangalin 5y agoThe instructions for compiling TeX from scratch are a little daunting, and sometimes unclear (e.g., having to define printer settings). Here are my Linux instructions for those who want to get core TeX up and running: https://tex.stackexchange.com/a/576314/2148 https://tex.stackexchange.com/a/576314/2148 Although TeX has many years of development effort behind it, the core functionality of converting macros to math glyphs is reasonably straightforward and can be accomplished in a few months---especially given that high-quality math fonts are freely available. Here's a Java-based TeX implementation that provides the ability to format simple TeX equations: https://github.com/DaveJarvis/JMathTeX https://github.com/DaveJarvis/JMathTeX The code supports neither vectors/matrices nor bracket sizing (PR welcome!): https://github.com/DaveJarvis/JMathTeX/issues https://github.com/DaveJarvis/JMathTeX/issues
- tzs 5y agoMIX was not yak shaving. In 1968 a book like TAOCP needed to cover assembly programming. Using an existing assembly language for an existing machine would not work well unless you wanted the book to be "TAOCP for CDC 6600 Programmers" or "TAOCP for Burroughs B5500 Programmers" or "TAOCP for IBM/360 Programmers" or similar. There were a lot of significant differences between different machines, and so if your book used any particular one for its implementations it would be harder to use for readers who used a different machine. MIX allowed Knuth to capture the important points that you needed to learn about assembly programming, without getting you tied to any particular machine.
- GnarfGnarf 5y agoI wrote a DVI converter for the Xerox 9700 laser printer and the Autologic APS-5 typesetter in the early 1980's. Ran on an Apollo Domain node. Fun times. I took a 1-week summer class at Stanford with Knuth. At lunch, he told us the story of a Chinese restaurant that served food in the style of the province of Hunan. They had chopsticks made with a typo, said "Human cuisine".
- svat 5y agoIncidentally, while this is a great post, the order of yak-shaving is actually pretty close to the opposite described in the post. He started with wanting a digital version of Monotype Modern 8A (what became Computer Modern). His first idea was to go to Xerox and use their scanning equipment to digitize the font, but they would only let him use it if they would have copyright on the resulting fonts, so he started looking deeper at the fonts himself. That gave him the idea of describing the font shapes from scratch (with equations) instead of simply scanning them, so he came up with METAFONT. To use his own digital fonts, he would need a typesetting system: TeX. He did implement TeX in SAIL, but when it became clear he would need to rewrite it in a portable way (Pascal), and Hoare suggested publishing the program as a book, he came up with literate programming and WEB. And as mentioned in another thread (https://news.ycombinator.com/item?id=29862858 https://news.ycombinator.com/item?id=29862858), TAOCP is itself a "yak shave", Knuth's response to being asked to write a book about compilers, in his first year of grad school in 1960 (given his compiler exploits earlier, like http://ed-thelen.org/comp-hist/B5000-AlgolRWaychoff.html#7 http://ed-thelen.org/comp-hist/B5000-AlgolRWaychoff.html#7). The publishers who were hoping to sell a book to aspiring early-1960s machine-language compiler-writers never got their wish, but they got something much more.
- rramadass 5y agoThis is Great! Articles like these are Inspiring; the Cleverness/Brilliance on display is just staggering and makes you really appreciate what is meant by the word "Genius".