A compatibility-focused Monkey compiler + VM implementation in Rust.
Behavior is locked against:
COMPATIBILITY.mdPROTOCOL.md
cargo buildUsage: monkey [run <path> | bench <path> | --tokens <path> | --ast <path>]
Examples:
cargo run -- run examples/hello.monkey
cargo run -- --tokens examples/control_flow.monkey
cargo run -- --ast examples/closures.monkey
cargo run --release -- bench bench/b1.monkeyStart REPL:
cargo run --
# or
cargo run -- replREPL meta commands:
:help:tokens [input]:ast [input]:env:quit:exit
The REPL session is stateful across inputs.
cargo test
make check
make compatGolden updates are explicit only:
make goldens-update
# or
UPDATE_GOLDENS=1 cargo test compat_Step 21 adds Java↔Rust parity checks:
make conformance
# or
MONKEY_JAVA_REF_CMD="java -jar path/to/ref.jar" cargo test conformance_ -- --nocaptureSee docs/conformance.md for command contract, fixture layout, and mismatch triage.
make release-checkmake bench
# or pass a compiled monkey binary path:
./scripts/bench.sh ./target/release/monkeyWindows (cmd) benchmark runner:
cargo build --release
scripts\bench.cmdRust vs Java comparison on Windows:
set MONKEY_JAVA_REF_CMD=java -jar C:\path\to\monkey-java.jar
scripts\bench.cmdOptional benchmark environment variables:
set MONKEY_RUST_BIN=C:\path\to\monkey.exe
set BENCH_ROUNDS=5
set BENCH_FILTER=b4
scripts\bench.cmdsrc/runtime/compiler/parser/CLI implementationtests/unit, integration, compatibility goldens, and conformance parity harnessexamples/runnable Monkey programsbench/benchmark programsscripts/developer and CI helper scripts
Do not change protocol-visible behavior without validating against COMPATIBILITY.md, PROTOCOL.md, compatibility goldens, and conformance parity checks.