Expand description
Shared execution path for the monkey-gc CLI (design doc §7).
Both CLI inputs — .monkey source and .mbc snapshots — funnel into
run_bytecode once a Bytecode is in hand, so results and runtime
errors render identically on both paths. This deliberately bypasses
gc::eval_source: exporting the final value back to an object::Object
fails for class instances and drops the runtime-error Span.
Functions§
- compile_
source - Parse and compile Monkey source, reporting the first error as a string.
- run_
bytecode - Execute bytecode on a fresh VM and render the final popped value the way
the REPL does.
instruction_budgetisusize::MAXfor normal runs; the CLI’s--max-instructionsthreads a finite budget through here. - run_
bytecode_ with_ output - Execute bytecode on a fresh VM while capturing all
puts/printoutput. The output is returned even when execution fails after producing it.