Short to write. Hard to get wrong.

Auk is a statically typed language that compiles to native code with LLVM. It is built so that code, especially code an AI model writes, takes few tokens and gets checked hard before it runs.

shapes.aukauk run shapes.auk 2 3
enum Shape { Circle(r: float), Rect(w: float, h: float) }

fn area(Circle(r)): float = 3.14159 * r * r  // a gap won't compile
fn area(Rect(w, h)): float = w * h

fn parse_side(s: str): float! {
  let x = float.parse(s) else fail("not a number: {s}")
  if x <= 0.0 { fail("sides must be positive") }
  x
}

fn main(args: [str]): int! {
  let sides = args.skip(1).map(a => parse_side(a))?
  let shapes = sides.map(s => Rect(s, s)) + [Circle(1.0)]
  for s in shapes {
    print("{s} has area {area(s):.2}")
  }
  0
}

test "area" { assert area(Rect(2.0, 3.0)) == 6.0 }
$ auk run shapes.auk 2 3
Rect(2.0, 2.0) has area 4.00
Rect(3.0, 3.0) has area 9.00
Circle(1.0) has area 3.14
$ auk run shapes.auk 2 x
error: not a number: x

Checked hard

The compiler names what's missing and how to fix it

Functions are written as clauses, one per case, and a case you forgot is a compile error. Errors and missing values are part of the type: float! can fail and str? can be absent, and neither can be ignored.

Every diagnostic has a stable code, a page in auk explain, and usually a fix-it: the exact edit, with its position, that an editor or an agent can apply.

enum Shape { Circle(r: float), Rect(w: float, h: float), Tri(b: float, h: float) }

fn area(Circle(r)): float = 3.14159 * r * r
fn area(Rect(w, h)): float = w * h
$ auk check shapes.auk
shapes.auk:3:4: error[E0400]: the clauses of `area` don't cover every case: `area(Tri(_, _))` is not handled
  |
3 | fn area(Circle(r)): float = 3.14159 * r * r
  |    ^^^^
  = note: add a clause for each missing case
  = fix: insert `fn area(Tri(b, h)): float = ??` at 4:35

Exhaustive clauses

fn area(Circle(r)) = …

One clause per case. Leave one out and the build stops, naming the case that's missing.

Errors in the types

T! T? ? else

Failure and absence are in the signature. ? passes an error up, and else handles it where it happens.

Declared effects

uses fs, net, time

A function says what it touches. Code that reaches the disk or the network without saying so doesn't type-check.

Units of measure

9.81<m/s^2>

Checked at compile time and erased at run time, so adding meters to seconds is caught at no runtime cost.

Shapes

structural generics

Generic code asks for the fields and methods it uses instead of a named interface, and is compiled per type.

Tests and contracts

test "…" { assert … }

Tests live next to the code in the same file. auk test runs them, and contracts state what a function promises.

Typed holes

Leave a ?? where you're not sure yet

Write the parts you know and leave a typed hole, ??, where you don't. The program still type-checks. auk holes describes each hole: the type it needs, the variables in scope, its contracts and the tests that call it.

That description is everything needed to fill the hole, whether you write it yourself or hand it to an agent through the MCP server's auk_holes tool.

auk build refuses to build a program that still has holes.

stats.aukauk holes stats.auk
fn median(xs: [float]): float? = ??

test "median" {
  assert median([3.0, 1.0, 2.0]) == 2.0
  assert median([]) == none
}
$ auk holes stats.auk
hole 1 at stats.auk:1:34 in fn median
  expected type: float?
  function:
    fn median(xs: [float]): float?
  in scope:
    xs: [float]
  tests that call it:
    test "median" {
      assert median([3.0, 1.0, 2.0]) == 2.0
      assert median([]) == none
    }

Built for agents

An MCP server ships in the binary

Run auk mcp and any Model Context Protocol client, Claude Code included, gets tools to read the spec, check, run, test, format and list holes. There's nothing to install beyond auk on your PATH.

The whole language reference is about 3,200 tokens, small enough to put in a prompt. auk check --json returns diagnostics with codes and fix-its, and auk run --trace=json records every call, return value, error and panic as JSON Lines.

$ claude mcp add auk -- auk mcp
auk_specThe language reference; agents read it first
auk_checkJSON diagnostics with codes and fix-its
auk_runRuns a program, optionally with a trace
auk_testRuns the test blocks and reports
auk_fmtFormats a file or a snippet
auk_holesEvery ?? hole, as JSON
auk_explainThe page for an error code

Packages: raft

Dependencies can't do more than you allow

Every package declares its effects. Your project lists the effects it allows in raft.toml, and raft refuses any dependency that needs more, however deep in the tree it sits. One file bounds what all your dependencies can do.

jsoncsvyamltomlxmlregexhttpurlclitermlogdatetimecompresshashuuidtemplatemarkdownsupgraphicsaudio…
a new projectraft
$ raft new weather && cd weather
created weather/ (app)
$ raft add http
error: http 0.1.1 needs effect `net`, but weather's raft.toml only allows []
  help: add "net" to [package] effects in raft.toml
$ raft add http        # after allowing net
  + http 0.1.1       uses net
  + json 0.1.0       (via http)
  + url 0.1.0        (via http)
  + encoding 0.1.0   (via url)
$ raft list
weather 0.1.0   uses net
└── http 0.1.1   uses net
    ├── json 0.1.0
    └── url 0.1.0
        └── encoding 0.1.0

Live reload

Change the code while the program runs

auk run --live swaps in new code every time you save. State, tasks and open sockets survive. A type error keeps the old code running.

If a change alters a struct's layout, only the tasks that use it stop, and their sup supervisors restart them on the new code.

Tooling

Everything in one binary

auk fmt formats, auk lsp runs the language server (a VS Code extension is included), auk dive is the REPL, and auk ir prints the compiler's intermediate code or its LLVM IR.

Performance

Native code, close to Rust

Seven programs written the same way in Auk and Rust, using the same algorithms and data structures. Auk traps on integer overflow, so the fair comparison is Rust with overflow checks on. Best of 5 runs on Apple Silicon; lower is faster.

BenchmarkSizeRust, overflow checksAukAuk ÷ Rust
sortsorting a list of ints10M0.190 s0.163 s0.86×
fibrecursion, integer math380.086 s0.092 s1.07×
treesenum allocation and matchdepth 181.648 s2.594 s1.6×
hashmapint map insert and lookup5M0.158 s0.266 s1.7×
stringsinterpolation, join, split, chars5M0.251 s0.451 s1.8×
nbodyfloat lists and float math5M steps0.162 s0.350 s2.2×
sievebool list index and store50M0.168 s0.399 s2.4×

Accuracy

Models write correct Auk from the reference alone

We gave three Claude models the 3,200-token spec and 20 function-level tasks with hidden tests, and no other Auk code to learn from.

59/60solved on the first try, across Opus, Sonnet and Haiku
20function-level tasks, each with hidden tests
~3.2ktokens in the whole language reference

Get started

Build from source

Auk is at version 0.1. You need Rust and LLVM 23; auk build also needs a system linker. auk run and auk test compile in memory, so they start right away.

Then read the language reference with auk spec and try the programs in examples/: start with hello.auk, fib.auk and tour.auk.

Install LLVM 23 and build the compiler and package manager.

$ brew install llvm@23
$ cargo install --path .

Write a program.

hello.auk
fn main() {
  print("Hello from Auk!")
}

Run it, or build a native executable.

$ auk run hello.auk
Hello from Auk!
$ auk build hello.auk -o hello && ./hello
Hello from Auk!