Open and answer this issue on GitHub.
selfhosting, tools, note · opened 2026-09-30 · updated 2026-10-06 · 0 comments
The owner’s instruction is to take self-hosting as far as it goes. Records: ADR-001 D4 (where the road ends), ADR-250 (how it is walked), ADR-252 (the tree), ADR-257 (the checker’s types).
Where it stands (scripts/self_hosting.py, also the README badge): 5.1 % of the toolchain is Nikaia, about 2 500 of 48 500 lines.
The road: a module moves whole, behind its own interface, leaves first; the Rust module stays as the adapter (D1, D2). Every move is a test of the compiler, since each found defects the suite had not, and they are fixed in the compiler in the same package, never bent around in the .nika (D3). The share is measured and published (D4).
Moved so far: did you mean, a dsl body’s parameters, describe’s reader, Fixed’s hash, the HTML template scan, the ledger’s line reader, what nikaia.toml may say, the whole syntax tree (a Span is two u32, Spanned[T] is generic), the constant fold, --trust’s text, and Ty/Shape plus the ledger’s small records.
Stage 1 is reached when main’s pipeline (read, check, lower) runs Nikaia end to end, with Rust left only as adapters to crates (winnow, clap, toml, the file system). Stage 2 is reached when the lowered compiler lowers its own sources to byte-identical Rust and a test compares the two (D5).
Remaining rings, in order: the checker’s types and algorithms; the modules that read only the tree and the types (dsl, traits, types, contracts::*, views, diagnostics); then the ones that read everything: check (21 k lines), emit (13 k), parser (3.9 k), project (3.2 k).
Sub-issues carry the next steps and the measured costs.