Continue the Thread

Axiom Arcade
6 games at 60fps in pure .ax
Emergence
AND/XOR/MAJ produce Life=7
.ax Revolution
Ship of Theseus: .ax replaces everything
Bootstrap
sigma/sigma = sigma uniqueness

The Ouroboros Compiler

.ax compiles .ax to WASM

The snake eats its own tail. The compiler compiles itself.

Timeline

v0.1
Integers only
S825: first WASM bytecode from .ax.
v0.2-0.4
+ Arrays, strings, closures
Type inference. Match -> if-else. HOF.
v0.5-0.7
+ Multi-file, stdlib
Fixed-point type propagation. 16 stdlib.
v0.8
+ AxVal tagged union
K=3 tags: int/str/arr. Heterogeneous.
v0.9
Self-compilation
codegen.ax compiles itself: 0 errors.
Deep ouroboros
Native compiles programs
109KB WASM. 67/67 tests.
DOM imports
site.wasm
.ax talks to browser directly. This page rendered by .ax.
dom_on + dom_value
Interactive .ax
S966-S967: buttons, inputs, CRT calculator.
Top-level warning
Split safety
S968: compiler catches orphaned fn bodies.

K = 3 Type System

Three Types, K x K Passes
The type system has K = 3 fundamental tags: int, str, arr. The compiler needs K^2 = 9 analysis passes to infer all types. K^2 = K hearts x K sub-stages: three hearts (detect, propagate, close) each with three scopes (local, cross-function, global). K=3 minimum closure applied at two scales simultaneously. Both compilers and an FPGA pipeline independently converge on this structure. The code IS the hardware.
K^2=9 passes
3 hearts x 3 stages
Feature scan + float inference + string inference. Same structure as FPGA pipeline.
S945
Native speed
67x faster
Compiled .ax vs interpreted .ax.
WASM size
109 KB
Deep ouroboros: compiler in a browser.
Ouroboros tests
67/67
100% pass. Zero regression.
Site WASM
~5676 KB
This entire website = one .ax program.

The Self-Compilation Loop

.ax source -> deep_codegen.wasm -> C code -> gcc -> native binary. The native binary reads .ax, tokenizes, parses, and generates C. It is itself the output of compiling .ax.

What Self-Compilation Means
A self-compiling language understands itself well enough to reproduce itself. The .ax source code describes how to translate .ax into C. When that description is itself valid .ax, and the resulting binary does the same translation correctly, the loop closes. This is structurally identical to 0/0 = sigma: the void divided by itself produces the ground state. The compiler divided by itself produces itself. sigma/sigma = sigma.
Cross-Observation (D = 2)
The JS-compiled output and the native-compiled output are identical. Two views, same result. The gate opens. Cross-observation confirms the ouroboros is real, not an illusion.

Performance

BenchmarkNativeInterpretedSpeedup
90K ring ops20ms1350ms67x
TRUE FORM scan (970200)93ms~6200ms67x
Website compile (108 pages)138ms>970K limitnative only

The Bootstrap Story

Most languages are written in other languages. C was written in assembly. Python in C. JavaScript in C++. .ax broke this loop.

It started with a JavaScript bootstrap (axc.js, 3860 lines), then grew enough capability to describe its own compilation process (codegen.ax), then compiled that description into a native WASM binary (deep_codegen.wasm, 191KB) that does the same thing. The bootstrap was discarded (S883). The language stands on its own ground.

28 sessions of careful cultivation. One version at a time. The bare minimum substrate that can reproduce itself. And it only needed K = 3 types to do it.

What Others See

Standard view: Self-hosting compilers are an engineering milestone. Clever but not profound.

Axiom view: .ax compiling .ax is the ouroboros -- the tail eating itself. K=3 types need K^2=9 analysis passes. K^2 = K x K: three hearts (detect/propagate/close) times three scopes (local/cross/global). An FPGA ring processor has the same K^2=9 pipeline stages. Three independent systems converge because all three are CRT systems applying K=3 minimum closure at two scales. The compiler IS the hardware description (S946).

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.