Yet Another Lox Interpreter, written in Java.
Table of Contents
YALIJA stands for Yet Another Lox Interpreter written in Java. Initially I wanted to claim that it's "a new programming language written in Java" because it sounds cooler :p, but it's not.
Lox is a programming language defined in Bob Nystrom's book, Crafting Interpreters. It's a language created for learning purpose only, and not used in real industry-standard environment like Java, Python, or any other major programming language does.
As for this interpreter, it's a tree-walking interpreter, which kicks up the core interpreter right after parsing is done, it walks through the AST while evaluating each node as it goes through. There's no compilation step, no bytecode generation, let alone machine code generation or any similar fancy stuff. According to the original author, it's relatively slow performance-wise, but I don't think it matters, it's a great start for learning.
I've always had this vague curiosity about how things works under the hood. Especially in software engineering, since we got all these amazing tools, frameworks, and programming languages popping up every so often. And upon realizing that most of these tools are hand-crafted by programmers, it kind of provoked my curiosity.
And one thing I'm always curious about is how programming languages are made, since programming language is the very fundamental building block to every tool that exists today, and it's also a thing every programmer uses on a day-to-day basis. Thankfully I stumbled upon Bob Nystrom's craftinginterpreters.com which provides a very valuable guidance for free.
You need to have JDK 11 or later installed on your computer. There are many flavors of JDK and tutorials online to guide you if you don't know how to install it, you can simply google it. Or you can go here if you're unsure.
Go to the releases page and download the latest release's jar. Then run it in your terminal, with the following command,
java -jar yalija-x.x.x-release-name.jar
The above command will run yalija in REPL mode. If you wanted to run a file, run the following command,
java -jar yalija-x.x.x-release-name.jar hello_world.lox
Documentation coming up soon
Distributed under the MIT License. See LICENSE for more information.
Danil Hendra Suryawan - danilhendrasr@gmail.com