Skip to main content

Module program

Module program 

Source
Expand description

Program representation for the experimental bytecode VM.

Constants reuse core::Value directly: the VM does not duplicate the Hara value model. The versioned vm::artifact codec persists validated programs for packaging and browser startup without reparsing source.

Structs§

CatchEntry
One catch clause of a TryEntry: the machine stores the caught value into binding and jumps to target when class matches.
FunctionPrototype
A compiled function. The entry function has arity and capture count 0; fn/defn forms contribute the remaining prototypes.
Program
A compiled program: a constant pool plus function prototypes.
TryEntry
A static handler table entry: the protected range [start, end) and its catch/finally regions. Registered outermost-first, so the machine’s reverse-order search finds the innermost covering entry.

Constants§

MAX_CAPTURES
Maximum number of captured values in one closure (u8 operand).
MAX_CONSTANTS
Maximum number of entries in the constant pool.
MAX_INSTRUCTIONS
Maximum number of instructions per function prototype.
MAX_LOCALS
Maximum number of local slots per frame (inherent to the u16 operands).
MAX_OPERAND_STACK
Maximum computed operand-stack depth for any function.
MAX_PRIMITIVE_ARGUMENTS
Maximum number of arguments in one primitive call (u8 operand).

Type Aliases§

FunctionId
Index of a function prototype inside Program::functions.