Go-Monkey-Go
is an interpreter for monkeylang, a
simple programming language created by
Thorsten Ball written in Go. This is adapted from
Ball's book Writing an Interpreter in Go.
Monkey has a very simple syntax. Monkey supports primitive data types such as integers, strings, booleans. Variable declarations are done like this:
let num = 10;
let b = num + 50;
let str = "Hello";
let flag = true;
Monkey also supports user defined functions:
let sum = fn(a, b) {
x + y;
};
There's also support for conditional statements:
if (a <= b) {
return true;
} else {
return false;
}
After reading this interview of Rob Pike, I was extremely curious about Go and it's advantages in developing and deploying software.
One of the best ways to get exposed to a programming language is to build something from scratch. Compilers and Interpreters are one of the most beautiful pieces of art in Computer Science. So here's my attempt of building an interpreter in Go. My goal is to get thinking about Go and Monkeylang and add other features to this programming language (I need to think more about what I want to add though).
Note: This repository will be constantly updated as I read the book and complete the exercises. Stay tuned! 🤓