Expand description
Tagged 64-bit term words — the single source of truth for the word/cell
ABI shared by the runtime (which builds and reads these on the heap) and
the compiler (which emits the same encoding into .rodata fact tables and
blobs). Keeping the tag values, the << 3 / & 7 split, and the
functor-packing layout in ONE place means codegen and runtime can never
drift one-sidedly.
A word’s low 3 bits are the tag; the payload sits in the high 61.
Pointer-like tags (REF/STR/LST/FLT/BIG) carry heap cell indices, not
raw pointers — the heap is a growable Vec<u64> and indices stay valid
across reallocation (and across backtracking truncation).
Constants§
- INT_MAX
- Largest magnitude representable as an immediate integer; values outside box to a TAG_BIG heap cell (full i64 range, v1 parity).
- INT_MIN
- TAG_
ATOM - TAG_BIG
- TAG_FLT
- TAG_INT
- TAG_LST
- TAG_REF
- TAG_STR
Functions§
- atom_id
- int_
value - Signed payload extraction (arithmetic shift preserves the sign).
- make
- make_
atom - make_
int - make_
ref - pack_
functor - Pack a STR header cell: functor id in the high half, arity in the low.
- payload
- tag_of
- unpack_
functor