Categorygithub.com/ChrisWilding/monkey
repositorypackage
0.0.0-20210926220453-8b724daca155
Repository: https://github.com/chriswilding/monkey.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

Monkey

Monkey is the programming language from Writing An Interpreter In Go and Writing A Compiler In Go by Thorsten Ball.

This repository contains my implementation of the monkey programming language written while following the books.

My implementation of a compiler and a virtual machine for monkey from Writing A Compiler In Go can be found on the main branch.

My implementation of a tree walking interpreter for monkey from Writing An Interpreter In Go can be found on the writing-an-interpreter-go branch.

My implementation of A Macro System For Monkey can be found on the a-macro-system-for-monkey branch.

Prerequisites

  1. Go 1.17

Build

$ go build

Run

$ ./monkey
Hello USERNAME! This is the Monkey programming language!
Feel free to type in commands
>> let people = [{"name": "Erik", "age": 24}, {"name": "Astrid", "age": 28}];
>> people[0]["name"];
Erik
>> people[1]["age"];
28
>> people[1]["age"] + people[0]["age"];
52
>> let getName = fn(person) { person["name"]; };
>> getName(people[0]);
Erik
>> getName(people[1]);
Astrid