Metadata-Version: 2.3
Name: monkeylang
Version: 0.0.1
Summary: Following `Writing an interpreter in Go` book by Thorsten Ball. https://interpreterbook.com/
Author: Subash Poudyal
Author-email: Subash Poudyal <hello@subash.fyi>
Requires-Python: >=3.13
Description-Content-Type: text/markdown


# monkeylang

**monkeylang** is a toy programming language and interpreter implemented in **Python**, inspired by the book  
[*Writing an Interpreter in Go*](https://interpreterbook.com/).

This project exists purely for learning and experimentation. It follows the structure, ideas, and design presented in the book, but reimplements them in Python instead of Go.

---

## About

Monkey is a small, interpreted language designed to be simple enough to implement from scratch while still being powerful enough to demonstrate real interpreter concepts, such as:

- Lexing and parsing
- Abstract Syntax Trees (ASTs)
- Evaluation and environments
- Functions, closures, and control flow

This Python implementation closely mirrors the book’s original Go-based Monkey interpreter, with adjustments made where Python idioms differ from Go.

---

## Installation
```bash
pip install monkeylang
```
This will install the `monkey` command-line tool.

---

## Usage

You can invoke the Monkey interpreter directly from the command line:

```bash
monkey hello.mk
```

Where `hello.mk` is a file containing Monkey source code.

In the future, you can also start an interactive REPL:

```bash
monkey
```

---

## Example

```monkey
let greet = fn(name) {
    return "Hello, " + name;
};

greet("world");
```

---

## Project Goals

- Learn how interpreters work by implementing one end-to-end
- Translate the concepts from Go into Python
- Keep the implementation simple, readable, and close to the book

This is **not** intended to be a production language or a fully featured runtime.

---

## Credits

- **Thorsten Ball** — Author of *Writing an Interpreter in Go*  
  https://interpreterbook.com/

- Original Monkey language design and Go implementation by Thorsten Ball

All core ideas, language design, and architecture are derived from the book. This repository is a Python reimplementation for educational purposes only.

---

## License

This project is provided for educational use. Please refer to the book’s license and terms when reusing or redistributing ideas or code inspired by it.
