Code: Megapixel99/lambda-language
lm is a small low-level language with four independent backends: C, WebAssembly, ARM64, and bytecode for a VM. Its test suite is built around the fact that there are four of them. Every program runs through all four and the outputs are compared byte for byte against each other and against a recorded expectation, so a backend that gets something subtly wrong disagrees with three that do not.
That suite is at 94 tests: 22 lm programs and 10 examples across four backends each, 59 compile-error cases, and 3 legacy programs. It is a good suite; there is one property it cannot check at all.
Every one of those 94 tests runs a program that the JavaScript compiler built. A compiler written in lm that quietly disagreed with its own output would pass all 94, because nothing in the suite ever asks it to compile itself.
The property
stage2 emit-c.lm, compiled by the JavaScript compiler
stage3 emit-c.lm, compiled by stage2
stage4 emit-c.lm,
Discussion
Your thoughts matter!
Your input is valuable—be the first to share it!