Interpreter
Overview
The interpreter executes compiled Ved bytecode.
It is responsible for:
- executing transitions
- mutating state
- enforcing slice limits
Execution Unit
Interpreter runs:
- one transition slice at a time
Core Function
run_slice(domain, message) → SliceResult
SliceResult
Possible outcomes:
- Completed
- Yielded
- Error
Execution Steps
- Load domain state
- Execute bytecode instructions
- Apply state mutations
- Emit messages/effects
- Return result
Gas Limit
Each slice is bounded by:
- instruction count
- execution budget
Preemption
If gas exhausted:
- execution yields
- scheduler resumes later
Determinism
Interpreter must:
- execute instructions deterministically
- avoid hidden state
- ensure reproducible results
State Mutation
State changes are:
- explicit
- atomic per slice