Monkey is a small, C-like programming language. This repository contains a Rust-based interpreter for the Monkey language.
It is based on the interpreter described in Writing an Interpreter in Go book by Thorsten Ball.
- Lexer
- Parser (In progress)
- Evaluation
- Extending the Interpreter
- Finishing touches
Monkey comes with several features commonly found in modern programming languages:
- C-like syntax for ease of understanding and usage.
- Ability to bind values to names using the
let
statement.
let age = 1;
let name = "Monkey";
let result = 10 * (20 / 2);
- Supports integers, booleans, strings, arrays, and hash data structures.
let myArray = [1, 2, 3, 4, 5];
let thorsten = {"name": "Thorsten", "age": 28};
- Arithmetic expressions are supported.
- First-class and higher-order functions, closures are supported.
let add = fn(a, b) { return a + b; };
let twice = fn(f, x) { return f(f(x)); };
If-else statements, loops are supported.
Access array and hash elements using index expressions.
myArray[0] // => 1
thorsten["name"] // => "Thorsten"