DEXA language logo

DEXA

Unified Compute Language

Spec (snapshot)

What DEXA actually supports right now

This is a living snapshot of the currently implemented language surface. Future features (tensors, actors, contracts, DX-VM, GPU) are intentionally omitted here until they exist in the compiler.

Types

Primitive types implemented in the typechecker and interpreter:

Functions

Declared with fn:

fn add(a: int, b: int) -> int {
    return a + b;
}

Variables & mutability

fn main() -> int {
    let x: int = 1;        // immutable
    let mut y: int = 2;    // mutable

    // x = 3;   // ❌ compile-time error
    y = y + 1; // ✅

    return y;
}

Expressions & operators

Currently implemented expression forms:

fn main() -> bool {
    let x: int = 10;
    let y: int = 20;
    let bigger: int = max(x, y);
    return bigger > 15 && bigger < 30;
}

Control flow

Implemented constructs

fn classify(x: int) -> bool {
    if x >= 0 && x < 10 {
        return true;
    } else {
        return false;
    }
}
fn countdown(start: int) {
    let mut x: int = start;

    while x > 0 {
        x = x - 1;
        if x == 2 {
            continue;
        }
        if x == 1 {
            break;
        }
    }

    return;
}

Builtins / special forms

The only special-cased function at the typechecker level right now is require:

fn main() {
    let x: int = 5;
    require(x > 0);             // condition must be bool
    require(x > 0, "x > 0");    // extra args allowed, unchecked for now
}

Execution model (current prototype)

The reference compiler currently targets a simple interpreted IR. Every DEXA program goes through:

  1. Parse to an AST (functions, blocks, let/let mut, if/else, expressions).
  2. Typecheck with a small, explicit environment of locals and function signatures.
  3. Lower to a tiny IR with locals, blocks, Let, Store, If, and Return.
  4. Interpret the IR to produce a result (int, float, bool, or unit).

There is no optimizer, no GPU backend, and no VM yet. This is intentionally minimal — the IR is a place to prove semantics before wiring in more serious backends.

This page tracks the implemented core only. Anything mentioned on the homepage but not listed here (tensors, GPU, actors, contracts, DX-VM) is still in design / prototype.