About the Series - Building a Lox Interpreter in Go
Although I've been working in technology for some time, I'm a relatively recent convert to software development. Although I think I've picked a lot of things up pretty well on my own, I don't have a CS degree, and I am always on the lookout for resources to help me close some of the resulting knowledge gaps. One such area is language design and implementation.
In late summer, 2021, I discovered the book "Crafting Interpreters" by Robert Nystrom, and I've found it to be a very readable, enjoyable introduction to these topics. The book begins with an overview of how files containing high-level, human-readable code, are combined together into something that a computer can execute. It then lays out a description of a reasonably full-featured scripting language, called "Lox," before moving on to the two largest sections of the book - first, one in which a Lox interpreter is written using Java, and, second, where a Lox virtual machine is implemented in C.
At this point, I have finished following along through the interpreter implementation. I learned a lot, but I will admit that, in my excitement with the material, I occasionally found myself typing some of the Java code in without giving it the attention I should have. That said, as someone who hasn't written a lot of Java, I also found that this exercise was a great way to get more comfortable with that language, while working on the practical project of implementing a Lox interpreter.
I thought about going back through the material a second time to reinforce my learning. However, I considered that, perhaps, I could use a different language for the interpreter, so that I COULDN'T ever just copy and paste - I would have to consider each piece, one by one. Additionally, if I wrote the interpreter in a language I wasn't super familiar with, I would also learn more about it at the same time. I've enjoyed working with Golang before, but it's been a couple years, so I decided I would build a Lox interpreter in Go as I followed along through the book a second time.
I plan to use this blog series to capture some of the things I learn along the way. I hope this will serve as a set of notes for myself, and, hopefully, some others might find it interesting too. We'll see!