Hacker News new | ask | show | jobs
by svat 938 days ago
When the books were written, the target audience would all be writing programs in (very different) machine languages, so the “mix” he created of existing computer architectures was a good one (https://retrocomputing.stackexchange.com/a/18176). The specific MIX language is no longer similar to present-day machines (self-modifying code is out of style, for instance), which is why he came up with "MMIX" and there's a book (“The MMIX supplement” by Martin Ruckert, but carefully proofread by Knuth) with the MMIX equivalents of all the MIX programs.

But in any case the algorithms are taught in English not MIX; the MIX programs are only a very tiny part of the books (https://news.ycombinator.com/item?id=14520230 — the 3000+ pages of Vols 1–4A have only 90 assembly programs), used only when the low-level details are actually relevant. So they can be skipped if one is not interested in them.

1 comments

For my argument, MMIX is not an improvement because it's still a low-level assembly language. True, you can simply skip over the MIX/MMIX source code, but that doesn't help me to like TAOCP. For me, (abstract) source code is the primary source of understanding a concept, and English text is just an accompanying explanation, not the other way round.

Your comments put TAOCP in a historical context. Yes, for the time, TAOCP was a huge achievement and it is a magnificient work. History is interesting, but the question here is about today, and I don't think it's the best way to learn the stuff today. (Again, just my opinion, there's no right and no wrong here.)

Yeah as you say it's just opinion/preference, but re:

> source code is the primary source of understanding a concept, and English text is just an accompanying explanation, not the other way round

note that most algorithms in TAOCP are only described in English (pseudocode), no (MIX) source code. (So if you want source code as primary you simply won't find it… but then again, a typical algorithm textbook like CLRS also would have only pseudocode).

The TAOCP pseudocode is also in a unique style that's not similar to modern programming languages — e.g. here's a note that Knuth wrote just earlier this year: https://cs.stanford.edu/~knuth/papers/cvm-note.pdf explaining (and generalizing/correcting) in his own style, the algorithm from a recent paper (https://arxiv.org/pdf/2301.10191v1.pdf): compare how the algorithm is described in Knuth (first page) vs the paper (second page): Knuth is simultaneously more high-level and more low-level (and also uses “goto” rather than “structured programming” for-loops, about which heretical preference of his I can write a long essay some other time :D).

It is possible to have different opinions about which one is the best way to learn the stuff today, but clearly Knuth rewrote it in his style because he thought it was better. ;)