What’s the best side project you’ve ever completed? For Keyhole Consultant Jake Everhart, so far, it’s writing his own interpretive programming language. He calls it Donut. Here’s more about why he made it, how he made it, and why it’s been so fun.
Summary
Side projects fight off Burnout, and that’s really why Jake embarked on the journey of writing Donut in the first place. Writing an interpretive programming language is basically writing an interpreter, which involves three main components.
- First, you have your Lexer, which breaks source code into tokens. It asks, “Do I recognize and understand these symbols?”
- Then you have your Parser, which takes those tokens and builds them into an abstract syntax tree (AST). It asks, “What do these tokens mean?”
- Finally, you have your Evaluator, which traverses through the nodes in the AST and actually does the evaluation. It asks, “How do I resolve these AST nodes?”
From a high level, once you nail down these three components, your language will be ready to function. And that’s where the fun stuff truly begins: you’re the captain of the ship, and you decide how the programming language will work. You have all the power when it comes to syntax, built-in functions, and developer tooling!
It technically works, and even though it’s not something you’ll probably start using on professional projects, it doesn’t matter. It’s a fun experiment, and according to Jake, it will definitely quell any burnout you’re experiencing!
Resources:
- Writing an Interpreter in Go by Thorsten Ball
- Jake’s Donut Repository