The code in this repository contains an interpreter for "Monkey" language, written by following Writing An Interpreter In Go by Thorsten Ball
Monkey is a simple and intuitive programming language designed for learning and understanding the fundamentals of interpreters and compilers.
- Lexer for tokenizing Monkey source code
- Parser for generating an Abstract Syntax Tree (AST)
- Evaluator for interpreting the AST and executing the Monkey code
- REPL (Read-Eval-Print Loop) for an interactive programming environment
- Support for integer, boolean, string, array, and hash data types
- First-class functions and closures
- Error handling and custom error messages
To run the Monkey interpreter, you will need:
- Go (version 1.16 or later)
- Clone the repository:
git clone https://github.com/mateuszmrw/monkey-interpreter-go.git
- Change into the project directory:
cd monkey-interpreter-go
- Build the project:
go build -o monkey
To start the REPL and interact with the Monkey interpreter, simply run:
./monkey
You will be greeted with a prompt where you can enter Monkey code.