Back to Projects
languagesongoing

ghoLang: A Custom Bytecode Virtual Machine & Interpreter

2026-06 – Present

ghoLang is a programming language runtime I built in C from the ground up. Source code goes through a hand-written single-pass Pratt parser that compiles it directly into dense bytecode chunks, handling operator precedence without any parser generator. That bytecode runs on a stack-based VM with call-frame tracking, dynamic constant pools, and O(1) string comparisons via interning and bitwise-AND hash probing. Memory is managed by a tri-color mark-and-sweep garbage collector with self-adjusting heap growth thresholds, and the language supports first-class Lua-style closures with heap-migrating upvalues alongside a class system with single inheritance and constant-time method dispatch. I've since expanded the runtime with string interpolation, iterable hash maps, and module resolution.

Impact

Hand-written single-pass Pratt parser compiling to bytecode
Stack-based VM with call frames and string interning
Tri-color mark-and-sweep garbage collector
Lua-style closures and a class system with single inheritance

Technologies

CPratt ParsingBytecode CompilationVirtual MachinesGarbage CollectionClosuresOOP Runtime Design