Deegen: A JIT-Capable VM Generator for Dynamic Languages [pdf]

2026-06-18

Link: https://fredrikbk.com/publications/deegen.pdf

HN Discussion: 1 points, 0 comments

Building a fast virtual machine for a dynamic language is one of the most labor-intensive undertakings in systems programming. V8, LuaJIT, PyPy, and HHVM each represent person-decades of work — hand-tuned interpreters, tiered JITs, inline caches, deoptimization machinery, garbage collector integration. The dirty secret is that most of this complexity is mechanical: once you've decided your bytecode semantics, the interpreter loop, the baseline JIT, and the inline cache plumbing follow predictable patterns. But "predictable" doesn't mean "easy" — getting them all correct and fast has historically required a small army of compiler engineers.

Deegen attacks this problem at the meta level. Rather than writing yet another VM, the authors built a generator that takes a high-level bytecode semantics description and emits a complete VM, including a tiered JIT compiler. The paper is from the same research line as LuaJIT Remake (the previous Deegen-adjacent work that produced a Lua interpreter outperforming LuaJIT's interpreter despite being auto-generated).

Why this matters to a technical audience:

The PDF is from Fredrik Kjolstad's group, which has a strong track record in compiler-generation research (TACO, the tensor compiler, came from the same lab). That pedigree alone makes it worth a read for anyone interested in compilers, language runtimes, or the gap between declarative specification and machine-code-quality output.

This is the kind of paper that sits at one upvote on a Wednesday morning and then resurfaces six months later when someone notices a startup or research group built something on it.

Why it deserves more upvotes: A serious academic attempt to make tiered JITs as easy to ship as interpreters — a potential generational shift in how dynamic language runtimes get built.

All newsletters