Skip to main content

logicaffeine_compile/semantics/
mod.rs

1//! The shared semantics kernel.
2//!
3//! ONE implementation of LOGOS value semantics — arithmetic, comparison,
4//! equality, collections, builtins — used by BOTH the tree-walker interpreter
5//! and the bytecode VM (and later the JIT's slow paths). Routing every engine
6//! through this module makes behavioral divergence structurally impossible,
7//! and every runtime error string for these operations lives here.
8
9pub mod acceptance;
10pub mod arith;
11pub mod builtins;
12pub mod collections;
13pub mod compare;
14pub mod crdt;
15pub mod format;
16pub mod policy;
17pub mod temporal;
18
19/// Maximum LOGOS call depth, enforced identically by every engine: recursion
20/// past this is a catchable runtime error, not a host crash. Set to 2500 (up
21/// from the old 1000) so naive deep recursion like ackermann(3,8) — depth ~2045
22/// — runs in the interpreter, closer to Node/V8's recursion headroom. The VM is
23/// heap-stacked (depth-safe); the native-recursion engines stay within their
24/// stacks at this depth (JIT ~2500 frames is a couple MB; the tree-walker's
25/// depth tests run on a big-stack thread).
26pub const MAX_CALL_DEPTH: usize = 2_500;
27/// The canonical depth-exceeded error.
28pub const CALL_DEPTH_ERR: &str = "Stack overflow: maximum call depth exceeded";