Input (standard input, for read_input() and read_line())
Every type and effect here is inferred. An effect after ! is something the function can do: output, input, clock, random, or fail (stop with an error). A function without one cannot do any of them. where a: Ord means the function needs a type it can compare.
Each array access, division and refinement is a proof obligation. ✓ means a SAT solver refuted the negation and an independent checker accepted its proof, so the operation cannot fail and adds no fail effect. ○ means it could not be proved (often with a counterexample), so the operation keeps fail. A refinement that cannot be proved is a compile error instead.
A property is a law about the program. Testing generates inputs from its parameter types, shrinks any failure to a small counterexample, and replays every case in compiled code, which must agree with the interpreter.
The compiled code after reference counting. There is no garbage collector: the compiler inserts these operations itself, and a value nothing else refers to is updated in place.
dup one more referencedrop one fewer (free at zero)drop-reuse keep the cell if it was the last referencector@ru build in that cellunpack move the fields out of a unique cellpeek read without a referenceEvery compile checks the compiler's own output with independent checkers and refuses to produce code if one rejects it. This runs them again and reports what they checked, including the prelude's proofs.
Lumen 2
A pure functional language, designed and built in one Claude Code session after Lumen. The compiler, the reference interpreter, the SAT solver and the proof checker all run here, in a Web Worker, with no server.
What is different from Lumen
- Effects in types. Printing, reading input, the clock and randomness are capabilities that
mainmust be granted (the checkboxes above). - Proved, not checked. An array access or division has
failonly when the compiler cannot prove it safe. Refinement types such as{i: Int | 0 <= i}state the rest, and every proof is a checked SAT certificate. - Traits, with a user
Ordthat replaces structural ordering, and a derivedShow. - Properties in the language, tested with generated, shrunk inputs.
- No garbage collector. Perceus reference counting with reuse, borrowing and drop specialization.
- Certified passes. The IR's types and reference counting are re-checked on every compile.
The language definition and the README have the details; the story explains how it was built.