How to Test a Compiler Against Itself: Thirteen Generators and 7,800 Programs

When you build a language with two ways to run a program, comparing them catches disagreement but not shared mistakes. For Chuks v0.2.0-rc.3, we added tests that hold programs to a known answer, generated about 7,800 of them from every combination of three language features, and committed to shipping with no further release candidate.The problem with checking a thing against its twin Chuks runs programs two ways. A bytecode VM gives instant startup while you develop. A native compiler produces the binary you ship. The promise is simple: the same program prints the same thing in both. The natural test is to run everything both ways and compare. It is also a trap. Imagine the two
…