30 Nov 2026
Tags:
Programming,
C++
Now that we have a harness to systematically capture our results for later analysis,
we can begin comparing the performance of an implementation of TeX’s data structures
in the original, 1980’s C style, with that of an implementation in modern C++ style.
It turns out that even casually-designed benchmarks can contribute useful results.
more ...
23 Nov 2026
Tags:
Why do we now isolate into levels? Knuth, working alone, was justified to implement a feature
across as many levels as he wished. In fact, the TeX code doesn’t really have levels in the strict
sense. (See Notes 1 and 4 above.) But modern software design would establish those levels
in design and enforce them syntactically. This makes more sense (essential?) for multi-person teams.
more ...
17 Nov 2026
Tags:
Programming,
C++
Benchmarks purport to give generalizable results. We don’t really care that one
specific run, of a specific program, on a specific machine configuration,
took a specified time. We care what that might indicate more generally.
For a benchmark to provide useful generalizations, its conditions must
be accurately recorded.
In my experience, recording the run conditions is surprisingly difficult.
Just recording the timing results isn’t informative. What optimization
level did I compile the program with? And was every file compiled with the
same level? Which version of the code produced that output?
more ...
28 Sep 2026
Tags:
Programming,
C++
While reading the TeX source code (see Part 1),
I repeatedly asked myself, “What if we implemented the data structures using modern tools?
Would the design be clearer? Would it perform better?”.
Knuth took enormous pains to save memory. He also designed TeX’s dynamic memory
allocator to be compatible with the early virtual memory systems of the 1980s.
While he did his best, the resulting code is obscure compared to how we would
implement this design using modern language facilities.
more ...
03 Sep 2026
Tags:
Programming
According to the order slip tucked into my copy, I ordered TeX: The
Program on June 5, 1986. For four decades as I moved through two countries and nine mailing
addresses, that book lived in boxes and
bookshelves. I took it out several times, intending to read it, each
time setting it aside because I wanted to understand TeX’s syntax
first. So I took down its companion volume, The TeXbook, read
a few chapters in, set that aside and never returned to either one.
more ...