Checked arithmetic by default
Overflow and division-by-zero trap with the exact source location — before any value is corrupted. No silent wraparound to reason about.
experimental native systems language · x86-64 · Windows & Linux
ae is a small, independently-built systems language. Every integer op is checked, memory is freed deterministically with no garbage collector, borrow-checked views stay zero-copy, and programs compile to C11 — small native binaries with no runtime VM.
git clone https://github.com/bdprk/ae && cd ae && cargo run -- run examples/hello.ae
Why ae
Correctness is non-negotiable; runtime cost, compile speed and binary size are tuned jointly against benchmark budgets.
Overflow and division-by-zero trap with the exact source location — before any value is corrupted. No silent wraparound to reason about.
Move semantics free memory at a known point. No collector pauses, no runtime bookkeeping, no unbounded heap growth.
Zero-copy &T, &vec, &string and string views, checked at compile time — no lifetime annotations to write.
Fixed arrays, growable vec, slices and string ops are all checked. Out-of-bounds indexing traps with a location instead of corrupting memory.
Tagged variants with payloads and compile-time exhaustive match. Reassigning releases the previous payload deterministically.
Monomorphized generics with bounds (Add/Eq/Ord/Copy), traits and impls with static dispatch — no method tables.
OS threads, channels (bounded, rendezvous, select), atomic cells, shared boxes, mutexes, a cooperative executor and a worker pool.
A legacy MIR backend and an independent pure-MIR backend emit identical semantics — the pure path is faster on recursion- and index-heavy code.
Compiles to C11 and links against libc only. Our benchmark programs build to tens of kilobytes — no bundled runtime VM.
The language
C-family surface syntax with the guarantees wired into the compiler, not bolted on.
// Every integer op is checked: overflow and /0 trap
// with the source location, before a value corrupts.
fn fib(n: i64) -> i64 {
if n < 2 { return n; }
return fib(n - 1) + fib(n - 2);
}
fn main() {
var total = 0;
for i in 0..10 { total = total + fib(i); }
print(total);
}
enum Shape { Circle(i64), Rect(i64, i64), Empty }
fn area(s: Shape) -> i64 {
match s {
Shape::Circle(r) => { return 3 * r * r; }
Shape::Rect(w, h) => { return w * h; }
Shape::Empty => { return 0; }
}
}
// Borrowed, not copied — checked at compile time.
fn sum(values: &[i64; 3]) -> i64 {
return values[0] + values[1] + values[2];
}
fn main() {
let values = [10, 20, 30];
print(sum(&values));
}
// Static dispatch: no method table anywhere.
trait Area { fn area(shape: T) -> i64; }
impl Area for i64 {
fn area(shape: i64) -> i64 { return shape * shape; }
}
fn report[T: Area](shape: T) -> string {
return "area=" + to_string(area(shape));
}
Benchmarks
Workloads are ports from the Computer Language Benchmarks Game. Every implementation uses the same algorithm and input, prints byte-for-byte identical output, and runs single-threaded on the same host.
Zig is built in ReleaseSafe mode (runtime safety on); ae builds with its default checked pipeline. Single-threaded, one process at a time.
Scope & honesty
It's an experimental prototype. These limits are stated up front by design.
&T, &vec, &string + string viewsvec, slicesmatch, structs, generics, traits (static)Option[T], recoverable *Result typesstd/net unimplemented)f64 has no implicit conversionsGet started
ae is source-distributed today. You need a Rust toolchain and a C11 compiler.
# clone and build the compiler
git clone https://github.com/bdprk/ae && cd ae
cargo build --release
# run a program (or use --pure for the pure-MIR backend)
./target/release/ae run examples/hello.ae
./target/release/ae build examples/arithmetic.ae -o arithmetic
./target/release/ae test tests_demo/strings_test.ae