Crux is a dynamically typed interpreted programming language.
I wrote this project to familiarize myself with inner workings of interpreted programming languages. I followed Robert Nystrom's Crafting Interpreters, which was a very valuable resource.
My initial goal was to create a language that I could use to solve Advent of Code 2024, however due to other circumstances, I was not able to finish the project in time.
Implemented features of Crux:
- Math operations
- Functions
- Branches
- Loops
- Classes (with inheritance)
- Lists
- Support for native C++ functions
var list = List();
for (var i = 0; i < 10; i += 1) {
list.push(i);
}
var avg = 0;
for (var i = 0; i < list.size; i += 1) {
avg += list.get(i);
}
avg = avg / list.size;
print(avg);
It was a lot of fun to see the features of Crux being added and it slowly becoming a somewhat usable programming language. This project definitely sparked an interest in programming language development and integration. One day, I would love to create a programming language running in a VM and ultimately a compiled language.
However, this project also made me interested in implementation of scripting languages into existing C++ codebases or game engines, which is something I would also love to explore.