Where the library is implemented
Open std.json and you are reading Luce. Follow a file read far enough and you reach Zig plus an explicit host callback. This section maps that boundary file by file.
Write policy and portable algorithms in Luce. Use Zig for compilation, memory representation, native resources, and host adaptation. Use LLVM and the platform linker only after Luce’s meaning is fixed.
Four library layers
.luc source imported through std., including pure algorithms and hosted wrappers.
Maintained packagestermui and future userland libraries resolved through the ordinary package mechanism.
Implementation machineryZig runtime and host services for memory representation, native resources, and platform integration.
The test for where code belongs
std.; independently versioned libraries belong in packages.Reachability determines shipped code
Standard modules join the ordinary module graph, are type-checked like project code, and produce MIR declarations. Reachability pruning removes functions, constants, builtin operations, and host effects the selected entry never reaches. A large pure module can therefore expose a broad API without forcing every function into every artifact.
Three levels of evidence
- Compiler and differential specsImports, types, visibility, specialization, effects, ARC, and results agree on native and oracle paths.
- Application-scale testsPackages, the editor, examples, and bundled applications exercise composition across larger programs.
- Public documentationThe Luce site compiles examples and audits documented public standard signatures against the embedded source.
When an operation becomes a runtime primitive
Measurements identify algorithms whose cost comes from representation or repeated host crossings. Those operations may receive a runtime primitive while keeping the public Luce wrapper and its behavior tests. The wrapper remains the API, and the primitive handles the narrow work that benefits from runtime access.