The Compiler

G42: D*K*b = 42 = ANSWER. CC0.

The 42nd CC0 patent kill is the compiler itself. .ax compiles .ax to WebAssembly. The compiler that built kills #1 through #41 is itself public domain. The ouroboros eats its tail.

The Ouroboros

Self-Compilation (PROVED, S1120)
.ax source code is compiled to WebAssembly by a compiler written in .ax. The compiler compiles itself, reaching a fixed point: the output of compiling the compiler with itself is byte-for-byte identical to the compiler. deep_ouroboros.wasm = 174KB. Zero external dependencies.
174KB
Total compiler size
tokenizer.ax (200L) + parser.ax (445L) + wasm_emit.ax (~2400L). One WASM file.
Fixed point
Self-identical compilation
Compiler compiles itself. Output = input. The loop closes.
Zero JS
WASI toolchain
wasmtime runs the compiler. No node. No npm. No webpack. Pure WASM.
3 ops
meet(*), complement(~), add(+)
The entire language is built from 3 operations on a ring. K=3.

The Pipeline

.ax source flows through 4 stages, each written in .ax:

tokenizer.ax
200 lines
Characters to tokens. charCode dispatch, zero allocation.
parser.ax
445 lines
Tokens to AST. Recursive descent, 24 node types.
wasm_emit.ax
~2400 lines
AST to WASM binary. K^2=9 analysis passes.
evaluator.ax
~810 lines
Runtime interpreter. REPL, meta-eval, ouroboros.

The compiler has K^2=9 analysis passes: the spider IS the web. Each pass tightens type information.

Try It: Live .ax Compiler

Type .ax code below. The evaluator (itself written in .ax, compiled to WASM) executes it in your browser:

The Ouroboros Test

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 full REPL at /repl runs the same compiler interactively.

Self-Hosting Compilers: CRT vs Proprietary

SizeGCC: 15M+ lines. LLVM: 30M+ lines. V8: 4M+ lines.deep_ouroboros.wasm: 174KB. ~3050 lines of .ax. One file.Dependenciesnpm install: 200+ packages. cmake: 50+ deps.Zero. .ax compiles .ax. No package manager.Self-hostingGCC compiles itself (multi-stage bootstrap).ax compiles itself to WASM. Fixed point in 1 generation.RuntimeNode.js: 70MB. Python: 30MB.wasmtime: 40MB. Or any browser. WASM is universal.LicenseGPL (GCC), Apache (LLVM), BSD (V8)CC0. Public domain. No license. No restrictions. Forever.CostMSVC: Visual Studio license. Xcode: Apple hardware.$0. Runs in any browser. Runs under wasmtime. Runs anywhere.

This work is and will always be free.
No paywall. No copyright. No exceptions.

If it ever earns anything, every cent goes to the communities that need it most.

This sacred vow is permanent and irrevocable.
— Anton Alexandrovich Lebed

Source code · Public domain (CC0)

Contributions in equal measure: Anthropic's Claude, Anton A. Lebed, and the giants whose shoulders we stand on.

Rendered by .ax via WASM DOM imports. Zero HTML authored.