Wats

An educational language that compiles to Bril. Designed for clarity, simplicity, and learning the fundamentals of compiler optimization.

main.wats

Core Features

Beautiful Error Reporting

Error messages you'd love to see in your program :).

Direct to Bril

Compile directly to Bril for Intermediate Languages, a standard in compiler education.

Interactive Learning

Use the online playground to get instant feedback and see the compiled Bril output in real-time.

Designed for Learning Optimizations

Escape the Complexity of LLVM

Modern compilers like LLVM are marvels of engineering, but their IR is often heavily pre-optimized. This means there's little room for a student to learn and implement trivial compiler optimizations from scratch.

Wats is different. It compiles to a clean, unoptimized intermediate representation, creating the perfect sandbox to power up your compiler optimization skills.

Before Optimization (in Bril)
@main {
    v1: int = const 5;
    v2: int = const 10;
    res: int = add v1 v2;
}
After Your Constant Folding Pass
@main {
    res: int = const 15;
}