Monkers
Bytecode compiler and VM for the Monkeylang language, written in Rust
Install / Use
/learn @poteto/MonkersREADME
monkers 🐒 + 🦀
Short for monkey-rs. An implementation of monkeylang. Previously, I implemented the interpreter in TypeScript. I am re-implementing the interpreter and later compiler in Rust as a learning exercise.
Building
$ cargo build --release
# See help
$ target/release/monkers --help
# Run the REPL with bytecode compilation
$ target/release/monkers
# Run the REPL with the tree-walking interpreter
$ target/release/monkers -s interpreted
Developing
Development REPL
Start the REPL by running cargo run, then entering some Monkey:
🐒 >> let a = 5;
5
🐒 >> let b = a > 3;
true
🐒 >> let c = a * 99;
495
🐒 >> if (b) { 10 } else { 1 };
10
🐒 >> let d = if (c > a) { 99 } else { 100 };
99
🐒 >> d;
99
🐒 >> d * c * a;
245025
Options can also be enabled:
$ cargo run -- -d # debug mode
$ cargo run -- -s interpreted # eval with interpreter
Command history is saved in history.txt.
By default, monkers REPL will compile your code into bytecode, then evaluate the bytecode with its VM. You can switch to the slower tree-walking interpreter with an arg:
cargo run -- interpreted
Helpful crates
cargo-watch
cargo-watch watches over your Cargo project's source. I use it to run my tests and cargo check whenever a file changes. It's aliased to cargo dev, which expands to:
cargo watch -x check -x test
Optionally you can append the RUST_BACKTRACE=1 flag to get backtraces.
Contributing
PRs are welcome! I am not a Rust expert, so I welcome any recommendations on more idiomatic Rust code.
Related Skills
himalaya
342.5kCLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
node-connect
342.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
85.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
coding-agent
342.5kDelegate coding tasks to Codex, Claude Code, or Pi agents via background process
