Skip to main content

Crate hara_vm

Crate hara_vm 

Source
Expand description

VM-only Hara execution surface.

This crate intentionally exposes artifact verification, preparation and execution, but no source or HALC compiler entry points.

Modules§

disassemble
Deterministic human-readable disassembler. Used in tests and in benchmark diagnostics.
validate
Program validation: one abstract-interpretation pass over the code vector before any execution. After validation the machine indexes without re-checking, and malformed programs never reach a panic.

Structs§

FunctionPrototype
A compiled function. The entry function has arity and capture count 0; fn/defn forms contribute the remaining prototypes.
Machine
A synchronous interpreter for one function of a validated Program.
PreparedCall
A stable global function cell plus a validated argument-call stub.
Program
A compiled program: a constant pool plus function prototypes.
ValidationError
A program rejected by the validator before execution.
VmError
A runtime failure with the failing instruction and its source position.
VmFiber
Host-independent lifetime for resumable bytecode execution. The machine owns every frame, local, operand and handler needed to continue.

Enums§

Instruction
One VM instruction.
Value
VmFiberState
VmOutcome
Terminal state of a machine run. Suspension variants belong to the later async milestone; adding them does not change instruction dispatch, only the set of exit points.

Functions§

decode_program
Decodes, authenticates, and validates a persistent VM program.
disassemble
Renders a program with instruction offsets, operands, constant previews, jump destinations, and source positions where available.
execute
execute_program
Executes a validated program’s entry function.
execute_program_with_globals
Executes a program against a caller’s namespace registry: globals intern into it and resolve from it, with no env bridge, snapshot, or refresh (issue #223).
load
prepare_call
Resolves a callable Var once and prepares a validated direct-argument stub.
validate
Validates a whole program. See notes/rust-bytecode-vm.md §9 for the rule list.

Type Aliases§

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