The 42nd CC0 demo is the compiler itself. .ax compiles .ax to WebAssembly. The compiler that built demos #1 through #41 is itself public domain. The ouroboros eats its tail.
.ax source flows through 4 stages, each written in .ax:
Source-level include directive expands files before tokenization. Test prelude dissolves boilerplate: one line replaces twelve.
The compiler has 9 analysis passes. Each pass tightens type information.
Twin Cunningham chains from just two seeds produce six primes. Two closure conditions complete the seven. The compiler that compiles itself is built on the chain that generates itself.
Seed (try 1 or 2):
Type .ax code below. The evaluator (itself written in .ax, compiled to WASM) executes it in your browser:
let f = fn(x) = x * x in f(42)
Three levels of self-reference. L1: arithmetic. L2: function definition. L3: the evaluator evaluates itself evaluating code. The snake eats its own tail.
See it live: the REPL at /repl interprets .ax using the evaluator, and Try It above does the same.
Source code · Public domain (CC0)
.ax source compiled to WASM via self-hosting compiler. Zero HTML authored.