Renderingla

Radix compiler

Radix is the Faber compiler. It is a private crate (radix/) that implements the full compilation pipeline from source text to target backends.

Pipeline

Radix lowers Faber source through three intermediate representations:

1. HIR (High-level IR) — the semantic core. Reader locale integration, type checking, and HIR-direct backends operate here. 2. MIR (Mid-level IR) — the execution-shaped IR. This is the semantic ownership boundary where borrowing and effect analysis run. 3. AIR (Autodiff IR) — a pure-functional transform for automatic differentiation and fusion, used by GPU target lanes.

Target lanes

LaneIROutputStatus
CPU runtimeMIRFMIR (Rust runtime)Shipping
LLVMMIRLLVM textExperimental
WASMMIRWebAssembly textExperimental
TypeScriptHIRTypeScript sourceExperimental
GoHIRGo sourceExperimental
GPU/WGSLAIRWGSL via WGPUExperimental

Architecture

Radix takes a text-emission approach rather than embedding LLVM. Target backends produce text in their respective languages, which are then compiled by the target's own toolchain. This keeps the compiler self-contained and makes target output human-readable.

Diagnostics

Radix emits structured diagnostic codes with stable identifiers:

  • LEX0xx — lexer errors
  • PARSE0xx — parser errors
  • SEM0xx — semantic analysis errors
  • DEFER0xx — deferred features (valid syntax, not yet implemented)

Every diagnostic can be explained via faber explain <code>.