Building ghoLang, My Own Bytecode Virtual Machine
ghoLang began as an attempt to stop treating programming languages as black boxes. I wanted to understand, in detail, what actually happens between typing a line of code and watching it run, so I built the entire runtime in C from the ground up.

From Text to Bytecode
Source code first passes through a hand written parser that I built using Pratt parsing, a single pass approach that handles operator precedence without needing any external parser generator. That parser compiles source directly into dense bytecode chunks, which then run on a stack based virtual machine complete with its own call frames and a constant pool for literals.
Making It Fast and Making It Remember
Two details ended up mattering more than I expected. The first is string handling: every string gets interned and compared using bitwise hashing, which turns what would normally be a slow operation into something close to constant time. The second is memory. I wrote a tri color mark and sweep garbage collector with a heap that grows on its own as the program needs more room, so ghoLang programs do not have to think about memory management at all.
Closures, Classes and What Came After
The language supports first class closures in the style of Lua, where functions can capture and carry variables from the scope they were defined in, along with a class system that supports single inheritance and dispatches methods in constant time. Since reaching that point, I have kept expanding the runtime with string interpolation, iterable hash maps and proper module resolution. ghoLang is still very much a work in progress, and that is exactly why I keep coming back to it.