Skip to content

Latest commit

 

History

History
54 lines (35 loc) · 1.34 KB

README.md

File metadata and controls

54 lines (35 loc) · 1.34 KB

Monkey Language Interpreter in Go

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.

Features

  • 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

Getting Started

Prerequisites

To run the Monkey interpreter, you will need:

  • Go (version 1.16 or later)

Installation

  1. Clone the repository:
    git clone https://github.com/mateuszmrw/monkey-interpreter-go.git
  1. Change into the project directory:
    cd monkey-interpreter-go
  1. Build the project:
    go build -o monkey

Usage

Running the REPL

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.