Monkey language Interpreter

Monkey language Interpreter

An interpreter for Monkey programming language written with GO by following the book 'How to write an Interpreter in Go'.

🐒 Monkey Lang — A Go Interpreter

This project is an implementation of the Monkey programming language, built by following the book “Write an Interpreter in Go”

Overview

Monkey is a small, interpreted, dynamically-typed language with C-like syntax and JavaScript-like semantics. It supports variables, functions, closures, arrays, hashes, and control flow structures like if and return.

This Go project implements:

  • Lexer — tokenizes the Monkey source code
  • Parser — builds an abstract syntax tree (AST)
  • Evaluator — executes the AST nodes
  • REPL — interactive Read-Eval-Print Loop for experimentation

Motivation

In the time of reading the source material, I was on the Golang hype train and I wanted to learn the language, and I being who I am, needed to learn the language with some practical challenges and twists.
That when I started to look around and stumbled upon the source material book and became infatuated by it (I think I finished it in a week or so).

This project taught me many things about interpreters and compilers in general, and made me interested in learning more about them, to point where I took a Principles Compiler Design Course in my college.