r/Compilers • u/No-Summer-1475 • 12h ago
I built Uranium: A statically typed language with a hand-rolled x86_64 JIT (no LLVM) and generational GC in modern C++
Hey everyone,
I wanted to share a major milestone on my hobby language project called Uranium, written from scratch in modern C++ (C++17/20).
I deliberately avoided LLVM because I wanted to learn and build the execution pipeline myself from the metal up.
Architecture Highlights:
Lexer & Parser: Emits .urc bytecode with peephole optimization. Supports strict static typing, generic syntax, pattern matching (match/case), nested f-strings (f"Outer: {f"Inner: {x}"}"), and async/await with a cooperative task scheduler.
Custom Native JIT: In src/native_jit_x64.cpp, I implemented a small assembler (X64Assembler) that directly emits raw x86_64 opcodes for hot loops and arithmetic routines into executable memory pages.
Generational GC: Two-tier Mark & Sweep (HEAP_COLLECT_YOUNG vs HEAP_COLLECT_FULL) with write barriers (writeBarrier(owner, value)) tracking remembered sets, plus object pooling.
Standard Library & Tooling: Includes raw TCP sockets, native cryptography (SHA256/Base64), embedded SQLite3, Godot engine bindings, its own build tool (omake), and a preview VS Code LSP extension.
The codebase is completely open-source. I'd really appreciate any code review or architecture critiques from other compiler authors:
https://github.com/bruhgit/Uranium-Programming-Language
What do you think of the tiered JIT / Loop Broker approach?