The day we deleted 405,013 lines
Quench's second runtime replaced the first in a single commit that removed 405,013 lines. This is how the rewrite was staged so that the cutover was boring.
On 8 October 2026 a commit titled "Remove legacy VM and make the shared runtime canonical" changed 2,029 files. It added 11,080 lines and removed 405,013.
A rewrite is usually where projects go to die. This one took about five weeks and did not stall, and the reasons are mostly about staging.
Why rewrite at all
The August engine had a lot of surface and a design that could not get fast. It was a tree-walking interpreter with a layered set of tiers on top, and a separate dynamic tier modelled on QuickJS. JavaScript and WebAssembly ran on different machinery. Every optimization had to be written two or three times, once per tier, and they drifted.
The new runtime started from a different question: what is the one representation that the interpreter, a baseline JIT, an optimizing JIT and an AOT compiler can all share? The answer was register bytecode with one record per operation, one value representation, and one object model, for JavaScript and WebAssembly both.
How the cutover was staged
The first attempt failed fast. On 11 September we tried growing the new core inside the old runtime crate. One file in it was 11,718 lines. Ten days later it was deleted, all 67,175 lines.
The second attempt lived beside the old engine. On 21 September the new interpreter was imported as a pinned snapshot in its own crate, with a note that production builds must not depend on anything outside the repository. Both engines built. A differential runner fed the same programs to both and compared results.
Conformance moved stage by stage. The test262 harness pointed at the new runtime one directory at a time. On 25 September alone, stages 19 through 25 were recorded as passing.
The cutover commit only deleted. By 8 October the new runtime was ready to stand alone, so the cutover was a deletion. That same day the WebAssembly spec suite read 67,124 of 67,124, and two days later test262 read 53,383 of 53,406.
What the new design made possible within a week
- 10 October: one general loop and a shared fast path for JavaScript and WebAssembly. A Wasm function and a JS function are the same kind of thing to the dispatcher.
- 11 October: a compiled execution mode. An abstract interpretation types every register at every instruction, integers stay unboxed, and Cranelift IR is emitted per instruction. A function compiles only when every reachable instruction has an emitter.
- 17 October: generational collection, where survivors keep their mark bits and a minor collection traces roots plus logged old owners.
On the WebAssembly side the shared loop was competitive with a dedicated interpreter straight away. A commit from 17 October records a Wasm benchmark score of 3,207 with the JIT off, against 2,896 for Wasmi v2 on the same host.
The second big deletion
On 1 November another commit removed 227,303 lines: every JavaScript file in the Node compatibility layer. Until then, Node's built-in modules were Node's own JavaScript library running on our engine. The commit message is blunt about the consequence: "Every built-in still loaded from Node's library now fails to load, and so does bootstrap."
That was deliberate. A runtime that carries 227,000 lines of someone else's JavaScript pays for parsing and holding it on every start. Node APIs in Quench are now Rust, checked against Node's behavior as an oracle.
What we would repeat
- Import the new thing whole, beside the old thing. Growing it in place failed in ten days.
- Compare the two continuously. A differential runner finds what a test suite does not.
- Make the cutover commit a pure deletion. If it needs new code, you are not ready.
- Delete the losing design in the same sync. This became a standing rule: competing implementations are allowed, and the loser is removed immediately.