go-monkey

Monkey is the programming language outlined in Thorsten Ball's Writing an Interpreter in Go.

It's a small language that is meant to serve as an educational vehicle for teaching the basics of compilation and interpretation of high level code.

This is a Go implementation that closely follows the implementation in the book but has a few extensions:

  • A minimal standard library and module system,
  • For-each loops for both arrays and dictionaries,
  • Possibly more, depending on what I come up with :)

Building, Running the REPL and Tests

To build the top level interpreter, run the following after checking out the project:

go build ./cmd/monkeyc/
# or: go build .\cmd\monkeyc\ on Windows machines.

Run unit tests:

go test -cover ./...

Run the REPL:

./monkeyc
# or: .\monkeyc.exe on Windows