Expand description
AST → bytecode compiler.
Compiles a checked vibe::ast::Program into a Chunk. The
compiler walks each function body and top-level statement, emitting
stack-based opcodes. Local variables are assigned slot indices; string
and IRI literals are interned into the constant pool.
§Compilation model
- Each user function gets a
FuncMetaentry and a code region. - Top-level statements are emitted into a preamble that runs before any function call.
- Control flow uses forward/backward jumps with patching.
returnemitsOp::Return; falling off the end of a function emitsOp::ReturnNull.
Enums§
- Compile
Error - Compiler error.
Functions§
- compile
- Compile a full
ProgramAST into aChunk. - compile_
expr - Compile a single expression (for cell bodies) into a
Chunk. The chunk’s preamble evaluates the expression and returns it.