monkey

command module
v0.0.0-...-8b724da Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2021 License: MIT Imports: 4 Imported by: 0

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL