Skip to main content

Crate monkey_wasm

Crate monkey_wasm 

Source

Functions§

analyze_lossless
Parse and validate Monkey source, returning a tagged JSON envelope the linter consumes. Unlike parse_lossless, this runs parser::validation (the semantic pass the interpreter and compiler share) so callers see undefined-variable, misplaced-this, and constructor-return errors — not just syntax errors. analyze is the linter’s single entry into the Rust side: TypeScript never re-implements parse or validation.
compile
compile_detail
compile_to_arm64
Compile Monkey source to AArch64 assembly and return a tagged JSON envelope of per-line text/kind/span records for the playground’s godbolt-style ARM64 view (arm64 backend design §12 V1).
compile_to_snapshot
Compile Monkey source into a .mbc snapshot and return a tagged JSON envelope with the raw bytes (lowercase hex) plus a byte-range annotation of the container layout for the playground inspector.
compile_with_debug
parse
parse_lossless
Parse Monkey source to JSON while encoding every i64 literal as a decimal string so JavaScript consumers do not lose integer precision.
run_gc_with_report
Execute Monkey source on the cycle-collecting VM and return a tagged JSON envelope.
run_snapshot
Execute .mbc snapshot bytes on the cycle-collecting VM — the browser twin of monkey-gc run foo.mbc, running the same VM with raise-site error classification so the envelope can carry a stable kind.
run_snapshot_with_output
Execute an untrusted snapshot on a fresh GC VM and capture observable output. stdout is present on both success and failure so callers can compare programs that print before raising an error.