monyet
Monyet
Crystal implementation of the Monkey Language
Monyet has a sibling implementation for Kotlin: monkey.kt
Status
The two books (Writing An Interpreter In Go and Writing A Compiler in Go) are implemented.
Commands
Before running the command you must have crystal and shards installed on your machine
| Script | Description |
|---|---|
tests.sh |
Run all the tests |
checks.sh |
Run format tool and ameba checks |
build.sh |
Release build |
benchmarks.sh |
Run the classic monkey benchmark (fibonacci(35)), requires one command (--eval,--eval-fast,--vm,--vm-fast) |
repl.sh |
Run the Monyet REPL |
Compiling variants
There are two different implementations for the compiler/VM.
- The default variant, based on
Array(UInt8)as Bytecode andOffsetArrayarrays for read operations - The slices variant, based purely on
Slice(UInt8)
The slices variant is more idiomatic but the default variant has better performance (around 10%).
To compile with a different variant you can the flag --define=slice to your compile or test. Additionally, both build.sh and test.sh have lines that you can comment/uncomment to enable different variants
Repository
monyet
Owner
Statistic
- 16
- 2
- 1
- 0
- 1
- 3 months ago
- November 12, 2021
License
Apache License 2.0
Links
Synced at
Tue, 11 Nov 2025 18:22:10 GMT
Languages