Skip to content

A Python interpreter for the monkey language from the book Writing An Interpreter In Go by Thorsten Ball

License

Notifications You must be signed in to change notification settings

loenard97/monkey-py

Repository files navigation

monkey-py

A Python interpreter for the monkey language from the book Writing An Interpreter In Go by Thorsten Ball

The Monkey Language

Monkey is a toy language from the books Writing An Interpreter In Go and Writing A Compiler In Go by Thorsten Ball. Check out the website here.

It includes some basic datatypes, conditionals and functions:

let x = 1;
let string = "Hello World!";
let array = [1, 2, 3];

let func = fn(x, y) {
    return x + y;
};

if (x == 0) {
    true
} else {
    false
}

This Implementation contains an Interpreter and a REPL:

python main.py <file_name>

interprets a .monkey file.

Running main without arguments starts a sandbox REPL, that evaluates each statement:

python main.py
>> x = 3
3

About

A Python interpreter for the monkey language from the book Writing An Interpreter In Go by Thorsten Ball

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages