o
odinpkg.dev
packages / library / sprak

sprak

0fd70cflibrary

An implementation of the Monkey language in Odin

MIT · updated 1 month ago

The Sprak Programming Language Project

Sprak is an implementation of Thornston Ball Monkey Programming Language in Odin. It closely follows Thornston Ball's books.

Why Sprak? Since Odin is a Norse god, I was looking for a Norse name for Monkey. Unfortunately, the Old Norse hadn't travel as far as Africa yet and didn't had a word for Monkey. Instead, I decided to just use the Norse word for language: språk. For convenience, I am dropping the overring accent over the a.

Prerequisite

If you want to follow along, you need a copy of Thornston Ball's Writing an Interpreter in Go.

You also need to install the Odin compiler.

Code Architecture

The code follows pretty much the book organization. The functionality is organized along the following files:

  • lexer.odin contains the types and procedures required for the lexer phase, this include the token and token type definitions.
  • repl.odin contains the code for the Read Eval Print Loop running the Monkey interpreter from the command line.
  • main.odin is the stub for the interpreter. During development, it is also used to host whatever fragment of code we need to debug.

Todos

  • Beef up the README

License and Copyright

The Odin code is copyrighted Robert Monnet 2026 and is provided under the MIT License.

The book and its original code are obviously copyrighted Thornston Ball 2016-2018.