Skip to main content

Module semantics

Module semantics 

Source
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.
format
Interpolated-string format specifiers ({x$}, {x.2}, {x>8}, …).
policy
Security-policy evaluation (Check … statements).
temporal
Calendar arithmetic (Howard Hinnant’s algorithms) and the clock.

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).