/monkey-lang

A Monkey implementation in Rust for learning purpose.

Primary LanguageRustMIT LicenseMIT

Monkey

A Monkey implementation in Rust for learning purpose.

This impelmentation includes both an interpreter and a virtual machine.

Usage

Virtual Machine

To run the Virtual Machine, use the following command:

cargo run

This will start a REPL where you can enter Monkey code.

Example:

>> let a = 5;
null
>> let b = 10;
null
>> let add = fn(x, y) { x + y };
null
>> add(a, b);
15

You can also run a Monkey file with this command:

cargo run -- sample.mk

Interpreter

To run the interpreter, use the following command:

cargo run --engine=eval

License

MIT