Lox is the language described in Bob Nystroms’s current work in progress book, Crafting Interpreters. Bob is the author of the extremely popular Game Programming Patterns book. He writes his books in an open manner by publishing drafts chapter by chapter as he finishes them. This allows the community to interact with the creation of the book. He is an extremely talented technical writer, and spends his days working on the Dart programming language at Google.
In Crafting Interpreters, two implementation of Lox are described. One focusing on simple, clean, and clear code in Java, and one focused on performance and low-level interaction and implementation in C.
I don’t really like working in Java if I can avoid it, not that there’s anything inherently wrong with Java. I didn’t really want to simply copy the code from the book either. So, I decided to write the clean interpreter in Python. I will probably try to work through the C interpretation in C though.
As of right now, this implementation is incomplete, and any and all code is my interpretation of Bob’s ideas.