Skip to main content

Module interpreter_module

Module interpreter_module 

Source
Expand description

The behavior interpreter as a module: the well-known ids and call conventions under which the runtime exposes its one BehaviorInterpreter on the engine.

The runtime assembles a host module under ID (the engine’s generic module builder) with functions attached to the interpreter’s entry points:

Payloads travel as structured Value arguments, converted generically through arora_types::value_serde — any serde type flows, no bespoke encoding — and SPAWN’s TaskHandle returns the same way. A Call{module_id: ID, id: LOAD|EDIT|SPAWN|HALT} — a remote’s BridgeOp::Call, or a behavior’s own call bridge — reaches the interpreter through the engine’s normal dispatch, like any module function.

Constants§

EDIT
Function id of edit: apply a GraphDiff to the running behavior.
EDIT_ARG
Argument id of EDIT’s one argument: the GraphDiff, as a structured Value.
HALT
Function id of halt: stop the run named by a TaskId.
HALT_ARG
Argument id of HALT’s one argument: the TaskId of the run to stop.
ID
Module id under which the runtime registers the behavior interpreter on the engine. Self-identifying like the vizij type ids: the ASCII bytes of “arora” lead the UUID, a small offset tails it.
LOAD
Function id of load: replace the running behavior with a Graph.
LOAD_ARG
Argument id of LOAD’s one argument: the Graph, as a structured Value.
SPAWN
Function id of spawn: start a task run from a Call under a RunPolicy, returning a TaskHandle.
SPAWN_CALL_ARG
Argument id of SPAWN’s first argument: the Call to run, as a structured Value.
SPAWN_POLICY_ARG
Argument id of SPAWN’s second argument: the RunPolicy.

Functions§

decode_edit
Read the GraphDiff out of an EDIT call.
decode_halt
Read the TaskId out of a HALT call.
decode_load
Read the Graph out of a LOAD call.
decode_spawn
Read the Call to run and its RunPolicy out of a SPAWN call.
decode_spawn_result
Read the TaskHandle out of a SPAWN call’s return Value.
encode_edit
Build the Call that applies diff to the running behavior.
encode_halt
Build the Call that halts the run named by task.
encode_load
Build the Call that loads graph as the running behavior.
encode_spawn
Build the Call that spawns call as a task run under policy.
encode_spawn_result
Convert the TaskHandle that SPAWN returns to a Value, to travel back as the call’s return.