Native Compiler · Substrate

HEXA-LANG

A fully hexa-native compiler — atlas-bound theorems, no LLVM in the loop
170×
codegen perf · S1 DONE
~94s
24k-line codegen · S2 PASS
0
LLVM, by policy
HEXA-LANG
↓ scroll

A Compiler that Cites

hexa-lang is a self-hosted native compiler. Every formula-bearing line cites an atlas theorem, every build passes eight strict-lint stages, and nothing leaves the toolchain that was not verified. It is the bottom of the dancinlab stack — wilson, echoes, anima and the hexa-* family all consume it; nothing imports back.

Most compilers trust the programmer. hexa-lang does not — it asks every formula where it came from. A line of mathematics that does not cite an atlas theorem is not a warning; it is a build failure. The compiler bootstraps itself to a bit-stable fixpoint, generates its own machine code with no LLVM in the loop, and treats provenance as a type-level invariant rather than a code-review courtesy.

Key Features

Atlas-Bound Theorems: Every formula must cite an atlas entry. Strict-lint stage four rejects the build if a formula line has no citation — provenance is a compile-time invariant, not a convention.
No LLVM, No C-Transpile: Fully self-hosted. C emission exists only as a portable artifact; the architecture is hexa-native, compiling to its own machine code.
n=6 Perfect-Number Primitives: The compiler is built on six primitives and six stages. The n=6 lattice is a tool used internally — never a constraint on what the language can express.

How a Build Runs

01
Parse
Source enters the frontend — tokenized, parsed, and resolved into a typed syntax tree.
02
Strict-Lint
Eight stages gate the build: atlas integrity, citation match, formula well-formedness, type soundness.
03
Lower
The tree lowers through HIR, MIR and LIR — each level a smaller, more explicit form.
04
Native Codegen
LIR emits native machine code directly. No LLVM, no transpile — the self-hosted path.

A Connected Toolchain

01

Self-Hosted Bootstrap

↳ The compiler compiles itself, bit-for-bit.

aprime_cc reaches a bit-stable self-host fixpoint — ap1f, ap2f, ap3f are byte-identical. The compiler reproduces its own output exactly, with no interpreter and no third-party backend in the loop.

02

Citation-Enforced Lint

↳ Eight strict-lint stages, every build.

Atlas integrity, citation match, formula well-formedness, type soundness — each is a gate. A build that skips a citation does not compile; honesty is enforced by the toolchain, not the reviewer.

03

HEXA-NATIVE-ONLY

↳ No LLVM, no GHC, no Rust runtime.

The language is responsible for its own code generation. The C path is a fallback for portability, never the architecture — the self-hosted native path is the canonical one.

04

A Downstream Ecosystem

↳ The whole stack compiles through it.

wilson the agent, echoes the discovery log, anima the consciousness model, and the hexa-* family — chip, bio, matter, arch — all sit downstream. hexa-lang is the substrate they share.

The hexa-native Campaign

The compiler is going fully hexa-native, in seven measured stages. S1 — codegen perf: DONE, the O(N²) lower_hir bottleneck is gone, 170× speedup. S2 — full codegen run: PASS, 24k lines compile end-to-end in ~94s with zero errors. S3 — self-host fixpoint: IN PROGRESS, proving gen1 → gen2 → gen3 byte-stability — the core gate. S4 — retire hexa_v2: blocked on S3. S5 — native build backend: DONE, env-gated HEXA_BACKEND=native selector. S6 — optimization passes: PENDING. S7 — own assembler + linker: PENDING. Every stage is measured-or-it-did-not-happen; no claim of self-host until S3 closes.