Expand description
The shared semantics kernel.
ONE implementation of LOGOS value semantics — arithmetic, comparison, equality, collections, builtins — used by BOTH the tree-walker interpreter and the bytecode VM (and later the JIT’s slow paths). Routing every engine through this module makes behavioral divergence structurally impossible, and every runtime error string for these operations lives here.
Modules§
- acceptance
- C2 Layer C — the receiver’s typed, bounded acceptance contract for shipped computation.
- arith
- Arithmetic, logical, and bitwise operators.
- builtins
- Built-in functions over already-evaluated values.
- collections
- Collection operations: indexing, length, membership, mutation, set algebra.
- compare
- Equality and relational comparison.
- crdt
- CRDT runtime values for the tree-walker interpreter.
- dom
- An in-process mock DOM — the shared oracle that gives the DOM builtins
identical semantics on the tree-walker and the register VM (they both run
call_builtin), so the sacred WASM==VM==tree-walker invariant holds even though the DOM is browser-only. - drive
- Driving a page from outside it: what a host’s driving verb answers, what that answer says, and the clock a page arms.
- escape
Escape to Rust:— raw Rust source embedded in a program, which only the Rust backends compile.- exact
- The exact real types in the interpreter’s value model: real algebraic numbers, computable reals, the program’s infinitesimal and the hyperreals it generates, infinite integers, ordinals, and the values a supertask leaves.
- failcode
- The failure codes a compiled module reports, each mapped onto its sentence in
logicaffeine_data::failure, the one place every tier’s failure wording lives. - format
- Interpolated-string format specifiers (
{x$},{x.2},{x>8}, …). - native_
kernels - The standard library’s native KERNELS — the
## To nativefunctions ofcrypto.lg(ML-KEM’s NTT, sampling, and serialization; the high-level ML-KEM / ML-DSA primitives) — as ONE table every tier reads. - patch
- The DOM patch stream: the byte format a compiled program writes and a host applies.
- policy
- Security-policy evaluation (
Check …statements). - storage
- Browser storage — the AREAS a page can keep text in, and the one place every tier decides what an area IS.
- temporal
- Calendar arithmetic (Howard Hinnant’s algorithms) and the clock.
- world
- The page world: everything a page’s run reads and writes besides the program’s own values — the document, the journal of the turns it took, the page clock, the sealed test world, and the browser’s storage.
Constants§
- CALL_
DEPTH_ ERR - The canonical depth-exceeded error.
- MAX_
CALL_ DEPTH - Maximum LOGOS call depth, enforced identically by every engine: recursion past this is a catchable runtime error, not a host crash. Set to 2500 (up from the old 1000) so naive deep recursion like ackermann(3,8) — depth ~2045 — runs in the interpreter, closer to Node/V8’s recursion headroom. The VM is heap-stacked (depth-safe); the native-recursion engines stay within their stacks at this depth (JIT ~2500 frames is a couple MB; the tree-walker’s depth tests run on a big-stack thread).
- PROGRAM_
NAME - The program name of a run that has no argv of its own — an in-process engine, a chip, a circuit.
Functions§
- argv_
with_ program_ name - The argument vector
args()answers:argvas C, Python and Go define it — the program name first, then the real arguments. A run given no vector at all (the in-process engines) still has a program name,PROGRAM_NAME, soitem 2 of args()is always the first real argument on every tier andlength of args()is never 0.