Introduction
Welcome to the AHA! Lang documentation - a modern programming language with an LLVM backend, written in Rust
Welcome to AHA! Lang
AHA! Lang — Advanced Hybrid Architecture — is a modern programming language with an LLVM backend. It is designed to be understood at a glance, yet strong enough to build real software.
What is AHA! Lang?
AHA! is a complete compiler project written in Rust. Source code flows through a lexer, a Pratt parser, a type-checking pass, LLVM IR code generation, and finally JIT execution — all inside one binary. No interpreter, no transpiler, no magic.
- LLVM-Powered — compiles to LLVM IR and executes through a built-in JIT
- Expression-oriented — the last expression is the result;
if/elseproduces values - Real type system —
Int,Bool, andStringare checked at compile time - Boolean algebra that composes — comparisons and
&&/||returnInt0/1 - Strings done right — a
{pointer, length}struct with O(1)len() - Honest tooling — clean CLI, VS Code extension, 305+ tests running in CI
Quick Links
A First Taste
AHA! is expression-oriented — every construct that can be a value is a value:
// the last expression of the program is its result
let x = 10;
let y = 20;
if x > y {
x
} else {
y
}Run it through the JIT and you get 20.
Requirements
- Rust (stable toolchain)
- LLVM 14 with Clang 14 and Polly (one-line install on Ubuntu/Debian)
See Getting Started for the full setup.