Large programs in Nikaia
- The problem
- Checks that work on a page of code have to keep working on a program of a hundred thousand lines.
- An example
- The compiler's own analyses, for sharing, pausing, what a function throws and which index stays in bounds, are Nikaia code, and the same checks run over them on every build.
- How it is done
- We write our own large programs in Nikaia: the compiler, the prover and its solver. Every defect the checks show in that code is fixed in the compiler, with a test, and not written around.
- The limit
- These are programs we wrote ourselves, by people who know the language from the inside. How often a check flags correct code across them is being measured now, and the figure is not in yet.
The compiler, written in Nikaia
The compiler is moving from Rust into Nikaia part by part. On November 15, 2026,
123,337 lines of the toolchain were Nikaia, 87.2 % of it, counted by
scripts/self_hosting.py. The compiler's own package,
crates/nikaia-std/src/compiler/, holds 295 files and about 197,000 lines.
The largest files are the text tiers (9,259 lines), the bounds walk (8,874) and the
prover's walk (3,944).
The package is checked as one program, each file with the rest beside it, and is lowered to Rust and built on every change. A design that only works on small examples shows up here first, as a slow build, a refusal of correct code or a message nobody can act on. Such a find is fixed in the compiler as its own change.
The prover and its solver, written in Nikaia
The compiler drops a bounds or overflow check when it can prove the check never
fails. The prover that decides this and the reference solver it asks, which decides
linear integer arithmetic, are Nikaia code, about 13,300 lines together. A second solver engine, a
CDCL(T) loop with simplex, fast paths and a strategy layer, is another 14,000 lines of
Nikaia, measured against standard SMT-LIB problem sets by
scripts/solver.nika. No solver is trusted: each answer comes with a
certificate that a small checker replays before the compiler uses it.
The prover's architecture →
The solver's inner loops were measured against hand-written Rust. Most of the gap found was in how an index is lowered to Rust (solver workload, section 8).
What the checks reach on that code
Over the 247 files of the package at that commit, nikaia lower-std --bounds --asserts
found 2,677 indexes and proved 1,544 of them in bounds (57.7 %), and proved
923 of 1,633 arithmetic steps free of overflow (56.5 %). No file was refused. The
1,846 checks that are not proved stay in the program and run.
(Formal verification,
section 2.)
Two figures are still missing: how many of the warnings across this code flag code that is in fact correct, and how the time spent checking grows with the size of the package. Both are measured in #1625, and every false alarm it finds becomes its own fix. One is known already: the outside-data check flags an index in one of our scripts that is safe (#1624).
Build a large program with us
Our own programs show what Nikaia does in the hands of the people who build it. The next step is a large program written by someone else, for a purpose of their own. We are looking for a few such projects, and we will help build them.
What we offer
- A defect or a missing part of the language that your project meets goes ahead of other work, and is fixed in the compiler.
- Help with the design and the code, from the people who build the compiler, in the open.
- A write-up we publish together: what worked, what the checks found, what they missed and what it cost, measured.
What an application shows
Tell us why your project would make a good case study for Nikaia. It helps to say:
- what the program does, and how large you expect it to become;
- why safety and speed both matter for it, for example a service that has to keep running, data that has to stay correct, or work that runs long or often;
- what it would show about Nikaia that our own programs do not, such as a different kind of concurrency, outside data, a domain with its own rules;
- whether the code can be public, so that every finding can be shown;
- who will look after it once it runs.
How to apply
Write to us on the Nikaia Discord with the points above. We answer each application, and we take on only as many projects as we can support well.
What to know first
Nikaia is pre-alpha. Rules still change, and some parts are missing; the pre-alpha page lists them. The Nikaia Foundation is a project, not yet a legal body, and it does not pay for work. What we can give is our time, priority in the compiler and a published result.
Go deeper
More under Made for good: Built in the openPre-alpha: what to expectWhy Nikaia exists