github.com/MarioAriasC/monyet
main / published Jul 21, 2026 / repository
An implementation of the monkey language on Crystal
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 |
API
- Ast
- Benchmarks
- Bool
Bool has only two possible values:
trueandfalse. - Char
A
Charrepresents a Unicode code point. - Code
- Compilers
- Evaluator
- HashKey
- HashPair
- Lexers
- MArray
- MBoolean
- MBuiltinFunction
- MError
- MFunction
- MHash
- MInteger
- MObject
- MReturnValue
- MString
- MValue
- Monyet
- Nil
The
Niltype has only one possible value:nil. - Object
Objectis the base type of all Crystal objects. - Objects
- Parsers
- String
A
Stringrepresents an immutable sequence of UTF-8 characters. - Symbols
- Tokens
- Utils
- Vm