Rules the language must obey. Each has a number so that spec sections, RFCs and compiler diagnostics
can cite them (P7). A feature that violates a principle needs an RFC explaining why, and the RFC
must name the principle it breaks.
08-ai-first.md). Constructs are judged for four readers — the AI author
(primary), the human reviewer, the machine, and the model inside the program — but when machine
checkability conflicts with human writing-convenience, the machine wins, because the AI writes the
code and the human only needs to understand and approve the result. A feature that eases human
typing but weakens the compiler’s ability to catch the AI’s mistakes is dropped.? (optional/propagate), ! (error union)
and @ (attributes).INDENT/DEDENT tokens; tabs
are an error.lume fmt is normative; the spec defines its output. Code
review never discusses style. The grammar also accepts an explicit-brace form that formats to the
canonical indented form.if, match, blocks, loop with break value yield
values. Statements are expressions whose value is ().=, no overloaded operators
outside named traits).f(a, b) ≡ a.f(b) for any function whose first parameter accepts
a (UFCS). Methods are functions; there is no separate method namespace.T?. Failure is T ! E. A
safe Lume program that compiles has a defined meaning on every input. unsafe blocks are the
only place where the programmer, not the compiler, carries that proof, and they are auditable
(lume audit unsafe).match,
range and refinement types, distinct newtypes, units of measure, linear capability types. The
type system is the first line of testing.let is immutable; records have value semantics; mutation requires
var/mut and is visible at the call site. Shared mutability is a named, visible type
(rc, arc, cell, @gc), never the default.? propagates; defer/errdefer clean up; panics are for bugs, not for expected failure, and
are not catchable in ordinary code.io, alloc, net, async,
prob, gpu, unsafe, interrupt, realtime, llm…) is inferred, enforced, and shown at
pub boundaries. Purity is the absence of effects, and the compiler exploits it.requires, ensures, invariant are part of the function, checked
in debug/test builds, usable as documentation, and provable by lume prove on the pure subset.
A spec that is not executable is a comment; Lume prefers executable specs.rc/arc and @gc regions are explicit opt-ins with visible types. unsafe,
asm, @layout, explicit allocators give total control when asked.dyn, comptime runs at compile time, defer is a jump.
If a feature cannot be made zero-cost, it lives in the standard library, not the core.@repr(c), @packed, @align, @soa, @mmio, @bits give
the programmer exact control over bytes, and the compiler never reorders what is declared
explicit. C interop is by importing headers, both directions.kernel), bare metal (freestanding), WASM,
portable bytecode (lumb). Cross-compilation from any host is the default, not a feature.record, table, index, relation, query, decimal, date are
core types/expressions, type-checked, with the same syntax over memory, files and databases.
SQL strings are not a thing.model, tensor[T, shape…], grad/vmap/jit operators,
kernel functions, prob effect, rule blocks and typed llm fns are language constructs
defined as sugar over the core, so the AI stack is in the language, not in a Python library.lume-core (~30 constructs with a
mechanised semantics). Features are sugar via hygienic macros where possible. The core changes
rarely and only with proofs updated.edition = N. Breaking changes happen only in a new edition with an automatic migrator
(lume fix --edition).lumec is written in Lume. Changes to the
language, compiler and standard library — including those proposed by AI through lume evolve —
pass the same gates: conformance suite, triple self-build, verified-core proofs, benchmarks, and a
human maintainer’s decision. The bootstrap root is a small C interpreter kept for reproducibility.lume does new/build/run/test/fmt/doc/prove/bench/pkg/repl/agent/evolve.
No external build system is needed for a Lume project, ever.todo and ? holes typecheck, run, and report the expected
type and context — for humans and for AI fill-in.compiler/stage1/protect.src, compiler/stage1/lprotect.src, [W0001], and lume build --protect) The toolchain lets the author of a program control how
much its shipped binary reveals (symbol stripping, obfuscation, constant encryption, selective
virtualisation, tamper seals), per build profile, opt-in and composable, without changing the
program’s meaning (P9/P25), weakening compile-time safety, or hiding anything from the author
themselves. Protection applies only to the author’s own artifact; the toolchain ships no feature
for attacking, deobfuscating or evading anyone else’s software. See 06-software-protection.md.07-competitive.md)LAWS block that the compiler
turns into a proof/test obligation on every build, so an edit (human or AI) cannot silently break
a cross-cutting rule. Per-function contracts (P15) guard a function; laws guard the whole program.
(Modelled on Bend 2.)[P35]
for each pub fn without a matching zero-argument fn test_<name>(). For example,
fn test_parse() satisfies the naming check for pub fn parse(...); this does not prove the
test runs or exercises the function. The warning appears in lume agent check JSON and does not
fail compilation. Example-based coverage and strict-mode enforcement remain future work. (Modelled on
NanoLang’s mandatory shadow block.)