https://github.com/shuhei/cymbal
Yet another Rust implementation of the Monkey language from "Writing an Interpreter in Go" and "Writing a Compiler in Go"
https://github.com/shuhei/cymbal
compiler interpreter monkey-programming-language virtual-machine
Last synced: 8 months ago
JSON representation
Yet another Rust implementation of the Monkey language from "Writing an Interpreter in Go" and "Writing a Compiler in Go"
- Host: GitHub
- URL: https://github.com/shuhei/cymbal
- Owner: shuhei
- License: mit
- Created: 2019-03-05T23:55:28.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2023-01-27T16:02:14.000Z (over 3 years ago)
- Last Synced: 2025-01-11T14:44:45.212Z (over 1 year ago)
- Topics: compiler, interpreter, monkey-programming-language, virtual-machine
- Language: Rust
- Homepage:
- Size: 188 KB
- Stars: 82
- Watchers: 3
- Forks: 12
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cymbal
Yet another Rust implementation of the Monkey language from "Writing an Interpreter in Go" and "Writing a Compiler in Go."
[](https://circleci.com/gh/shuhei/cymbal)
## Development
Start REPL:
```sh
# Run in eval mode to directly evaluate AST
cargo run -- repl
# or
cargo run -- repl --eval
# Run in compile mode to compile AST into bytecode and execute it on VM
cargo run -- repl --compile
```
Build:
```sh
cargo build
```
Test:
```sh
cargo test
```
Benchmark with recursive fibonacci:
```sh
cargo run --release -- benchmark --eval
cargo run --release -- benchmark --compile
```
## License
MIT