Custom Programming Language

Noria

C++20 LLVM CMake

A compact, defensible compiler MVP with a statically typed language, full pipeline in C++/LLVM, example-driven tests, and CI on every push.

Test Suite and CI

Tests are example-driven: every program in examples/basic must compile, with native exit-code checks on macOS where applicable.

Verified run_examples.sh · GitHub Actions

53 passing
19 type errors
5 parse errors
49 native runs

GitHub Actions on every push and PR (macOS + LLVM). Optional local runs with ASan/UBSan (just sanitize) or Valgrind (just valgrind).

BUILD_DIR=build ./tests/run_examples.sh

Parser and type checker errors include source line and column information:

./build/noria examples/invalid/unknown_variable.noria -o build/out.ll
noria: error: 2:10: typecheck: unknown local variable 'missing'

Compiler Pipeline

Sample compilation of examples/basic/factorial.noria: click a stage for per-pass output from a local just build run.

  1. Native binary

Current MVP

The compiler supports i32 and bool, local variables, assignment, arithmetic, comparisons, if / else, while loops, functions, recursion, lexical scoping, static type checking, LLVM IR generation, optional LLVM optimization, and native macOS executable output.

examples/basic/showcase_bool_scope_loop.noria
fn adjust(value: i32) -> i32 {
  let result: i32 = value;
  let small: bool = result < 10;

  if small {
    let bonus: i32 = 5;
    result = result + bonus;
  } else {
    let penalty: i32 = 2;
    result = result - penalty;
  }

  return result;
}

fn main() -> i32 {
  let i: i32 = 0;
  let total: i32 = 0;

  while i < 5 {
    total = total + adjust(i * 3);
    i = i + 1;
  }

  return total;
}

Why I Built This

A compiler is where software and hardware meet. Building Noria meant tracing that path myself and not treating any stage as a black box.

  • End-to-end ownership. I learn best when I can follow a whole system from input to output. Noria sharpened that habit: every bug belongs to a stage, and every stage has tests.
  • Self-directed depth. No course deadline or internship brief, I picked a hard, long-horizon problem that I can continue to explore in my own time.
  • Better instincts in production work. Debugging across layers: is this a type error, a codegen bug, or a toolchain issue? These skills transfer directly into shipping production code at scale.

Noria V2 (In Development)

Extending the i32/bool MVP to floats, I/O, strings, arrays, and structs: sequenced so each phase ends compiling and tested.

3 / 7 phases Target: end of July 2026 · part-time
  1. Phase 0 Type refactor: generalize Type/IrType (53 examples stay green)
  2. Phase 1 Unary, logical, bitwise ops · modulo · else if · as cast parse
  3. Phase 2 f64 · print I/O · casts · sqrt/pow · FizzBuzz + hello world
  4. Phase 3 Strings: literals, indexing, len, concat
  5. Phase 4 Arrays + lvalue assignment path
  6. Phase 5 Structs: decls, construction, field access
  7. Phase 6 Docs, harness polish