Slow Code, Long Shadows: Rebuilding a 1960 Algorithm From a Scanned Paper
Photo: vintage mainframe computer punched cards 1960s, via substackcdn.com
My grandfather worked at a computing institute in the Saarland back when a machine filled a room and 'deploying' meant punching cards in the right order. When he passed, a box of his papers made its way to my garage in Ohio, and it sat there for years until a rainy weekend turned me into a very specific kind of archaeologist.
The site you're reading is called Dipperstein for a reason. A dipper doesn't sip. It goes all the way down into the well. So I pulled out the thickest paper in the box — a German-language writeup of a string-matching precomputation technique from the early 1960s — and decided to re-implement it from scratch, no libraries, no shortcuts, no asking an LLM to summarize it for me.
Reading a Paper Is Not the Same as Understanding It
I've skimmed hundreds of papers. I can nod along in a design review about any of them. Actually translating a 60-year-old algorithm into working Go code is a different animal entirely.
The first thing I learned: the paper had gaps. Not because the author was sloppy, but because the intended reader was another researcher who shared the author's assumptions. The edge cases — empty patterns, repeated characters, patterns longer than the text — simply weren't discussed. When I filled those gaps in code, I had to decide things. That decision-making is the part of engineering that no amount of skimming ever teaches you.
The Side-by-Side That Surprised Me
Once my implementation passed a hairy test suite, I benchmarked it against a naive substring search and against Go's standard strings.Index on a 50 MB corpus of public-domain books from Project Gutenberg.
The results humbled me in a useful way:
- Naive search: ~2.1 seconds on the worst-case pattern
- My re-implementation: ~340 milliseconds
- Standard library: ~95 milliseconds
My hand-rolled version was three and a half times faster than naive — and still slower than the thing any working engineer would just call. That gap between my code and the standard library is where decades of accumulated micro-optimizations live: cache-friendly memory access, assembly-tuned inner loops, hard-won branch prediction wins.
And that's the point. The standard library isn't magic. It's the same paper, dipped into over and over by thousands of engineers, each one going a little deeper.
What a Dead Man's Marginalia Taught Me About AI-Assisted Speed
Here's what stuck with me. In the margins of the paper, my grandfather had penciled corrections, questions, a crossed-out counterexample. He didn't trust the text; he interrogated it. That's exactly the muscle we're all at risk of atrophying when we accept an AI-generated function at first glance because it looks right.
I'm not anti-AI tooling — I use it daily. But the marginalia changed how I use it. Treat generated code like a paper from 1962: something to be tested, doubted, and understood, not a final answer. The engineers whose work outlives them, like my grandfather's, are the ones who went deep enough to find where the document was wrong.
The Case for Deliberate Slowness
A month is a long time to spend on an algorithm nobody asked me to implement. But here's what I got out of it:
- A working mental model I can now rebuild from memory, which has already helped me debug a real production issue.
- A benchmark harness I keep reusing for side projects.
- A habit of writing my own marginalia — a
NOTES.mdin every repo where I record what confused me and how I resolved it.
The old ways don't win because they're old. They win because depth compounds. Skimming gives you breadth today; dipping gives you leverage for a decade.
If you've got a classic paper you've always meant to read properly, do it the slow way. Implement it. Break it. Benchmark it against your standard library and eat the humbling. The code you write that way might outlive you too.
The full repo, including the test suite and benchmark data, is up on my projects page. The marginalia, sadly, stay in the garage.