Skip to content

An implementation of a C-like programming language. Guided by "Writing an Interpreter in Go" and "Writing a Compiler in Go" by Thorsten Ball.

License

Notifications You must be signed in to change notification settings

cszczepaniak/monkey

Repository files navigation

Monkey

This is my repo for working through Writing an Interpreter in Go and subsequently Writing a Compiler in Go, both by Thorsten Ball. They implement a programming language called Monkey.

Why are you learning about interpreters and compilers?

My curiosity began because I used to work professionally quite a bit with MATLAB, but sadly MATLAB lacks modern tooling that I became accustomed to - namely, I wanted MATLAB to have a formatter, much like prettier for JavaScript/TypeScript or gofmt for Go. I set out to see what it would take to write one myself, and quickly discovered you need to parse the language to be able to format it... but I didn't know anything about that!

It turns out MATLAB is a major pain to parse because of some of its peculiar syntax, so my formatter never took off, and I since have stopped working with MATLAB. But I was left with my curiosity about lexers, parsers, ASTs, and all the rest of the moving parts that are required to compile a language. I watched most of a livestreamed series on YouTube from Immo Landwerth where he builds his own programming language, and he recommended these two books as a great resource for learning - so here we are!

About

An implementation of a C-like programming language. Guided by "Writing an Interpreter in Go" and "Writing a Compiler in Go" by Thorsten Ball.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages