The Stepanov series is now a playlist. Nine episodes, animated and narrated, built from the same posts and the same code.
The series has one thesis, and it runs through every episode. You do not invent an algorithm for each new type and then hope it generalizes. You go the other way. You declare the algebraic structure a type carries, the operations it supports and the laws they obey, and once that declaration is in place the algorithm is already determined. Write it once against the structure, and it runs correctly on every type that satisfies the laws. The structure does the work; the algorithm is what falls out.
The arc starts where the algebra starts, with the monoid: an operation, an identity, and associativity, which is exactly enough to make repeated combination well defined and reassociatable. From there the series climbs the lattice of structures, adding one law at a time and watching the set of available algorithms grow with each addition. By the end you are looking at the whole picture at once: a family of structures ordered by strength, and the algorithms sitting at the level where they belong, no lower and no higher than the laws they actually need.
I wrote the whole series as a dialogue between a teacher and a student, and the animation keeps that format. The student asks the questions you would ask, the ones that sound naive and turn out to be the right ones, and the teacher answers by building the structure up in front of you rather than handing it down. Watching the two of them work through it is, I think, closer to how the ideas actually land than a lecture would be.
This is the material Alexander Stepanov spent a career on, the thinking behind the STL and behind generic programming as a discipline rather than a trick. The series is my attempt to teach it the way it deserves to be taught: from the algebra outward, so the code looks inevitable instead of clever.
The playlist
Open the playlist on YouTube (9 episodes)
Episode list
- Algorithms Arise from Algebraic Structure
- One Algorithm, Infinite Powers
- Polynomials as Euclidean Domains
- Forward-Mode Automatic Differentiation via Dual Numbers
- Reverse-Mode Automatic Differentiation
- Semirings: One Algorithm, Six Graph Problems
- Homomorphisms: Fold Is the Universal Map
- Free Algebras: Why Lists and Polynomials Are Universal
- Lattices: Fixed Points and Tarski's Theorem
Discussion