Reviewing my own thesis, eleven years later
August 26, 2026 · Programming
In 2015 I defended a PhD on embedding domain-specific languages into Java — the J% language, where an SQL query or a regular expression is a first-class type that the compiler checks, instead of a string that fails at runtime. This month I rebuilt the compiler from the thesis design (jmodv3): the regex, SQL, GetSet and JSON modules, DDL schema checking, even the live-JDBC probe. Rebuilding something you wrote a decade ago is a peculiar experience. Code does not let you hand-wave.
Then I tried an experiment. I put Chapter 3 — the design chapter, the one that was supposed to be the theoretical foundation — in front of an AI reviewer, with the reimplementation checked out next to it, and asked for an honest referee report. What came back was the review you hope to get from your committee, and I, mercifully, did not.
The gaps
The chapter described mechanisms and never stated the theorem they rest on. J% is a source-to-source compiler whose last stage is javac, so the entire safety story reduces to one conditional claim: if every DSL module validates soundly, generates well-typed code, and actually implements its declared type mapping, then the generated program inherits Java's type safety. That is a two-line proof — and the obligations on the module, the contract that makes it true, were never written down. The chapter never even identified what has to be trusted.
It got worse in the details. The grammar defined an external body as "{" { AnyCharacter } "}", which does not determine where the body ends; the implementation counts braces, and the spec never said so. The type mapping introduced compatible and dominant types by example and stopped, with nothing about what happens when two conversion routes disagree. Configuration classes were declared to follow "standard Java semantics" when they are in fact a small declarative language wearing Java's syntax. And the errata: a JVM type-signature table reproducing an obsolete pre-JNI format, auto-boxing presented as soft typing (it compiles to Integer.valueOf, and it is a plain coercion), and a modifier rule that contradicted itself two sections apart.
The best gap was the one hiding inside a feature. The SQL module can validate a query against a live database at compile time — which means compilation depends on mutable external state. The verdict is not a proof, it is a snapshot: valid until someone runs ALTER TABLE. Checking against the world yields a lease, not a proof. The thesis implemented two of the three possible designs here (schema file, live probe) without ever naming the dimension; a decade later Rust's sqlx hit the same wall in production and invented "offline mode" — the third point, snapshot-and-pin, reinvented under another name. That is the observation I wish the 2015 text had made.
What was done
I wrote the revised edition: the module contract stated as four clauses with the safety theorem and a blame corollary on top, an oracle taxonomy with snapshot soundness for the live checks, the lexical rules made precise enough to test against, and the decorative ISO 9126 figure replaced by a traceability table that actually says which mechanism delivers which requirement. It is typeset properly and lives on the publications page and on the J% page, next to the thesis it revises — the PDF is here.
And in the way of all side quests, publishing it fixed the site: pressing "Read" on the publications page revealed that the PDF overlay had been quietly broken — Tailwind's space-y utility was applying a margin to a position: fixed element (yes, margins apply to those), shoving the overlay down the page, and a browser configured to download PDFs got an empty dark sheet with no way forward. Both dialogs now render through a portal, the overlay grew an "Open in new tab" button, and the whole thing shipped as release 1.17.0.
What comes next
This does not end with a corrected chapter. The revision left a to-do list that reads like a language roadmap — an escape rule for the body delimiter, named builders instead of positional constructors, snapshot-and-pin for the schema checks — so I plan to build a v4 of the J% compiler: a new and updated grammar and a rethought offering, fine-tuned for 2026 and beyond rather than for the Java of 2015. The revised chapter is, in effect, its design document.
A reimplementation is the best referee your design will ever have. A reviewer who has read everything and holds nothing back, with your code checked out beside the text, is the second best. Eleven years turns out to be a good interval for reviewing your own work: long enough that you read it as a stranger, short enough that you can still fix it.