Code is cheap to generate. Expensive to trust.
Aver is a language where every function carries its intent, side effects are visible in the type system, and tests are executable specs next to the code. The optimization target is the reviewer, not the generator.
MIT licensed · Written in Rust · v0.16 · crates.io
fn safeDivide(a: Int, b: Int) -> Result<Int, String> ? "Safe integer division. Returns Err on zero." match b 0 -> Result.Err("Division by zero") _ -> Result.Ok(a / b) verify safeDivide safeDivide(10, 2) => Result.Ok(5) safeDivide(7, 0) => Result.Err("Division by zero") fn reportDivide(a: Int, b: Int) -> Unit ? "Prints the result of safeDivide." ! [Console.print] Console.print(safeDivide(a, b))
Every function carries a prose description. The why stays with the code.
fn classify(c: Float) -> String ? "Human-readable category." match c <= 0.0 true -> "freezing" false -> "comfortable"
I/O, network, disk — declared on every function. No hidden side effects. Run a tracked Console.print in-browser.
fn greet(name: String) -> Unit ? "Greeting to stdout." ! [Console.print] Console.print("Hi, {name}!")
Tests live next to the function. Checks, docs, and regression guards — in one place.
verify divide divide(10, 2) => Result.Ok(5) divide(7, 0) => Result.Err("zero") divide(9, 3) => Result.Ok(3)
Architectural choices live in the code, not a wiki. Searchable and exportable.
decision UseResult chosen = "Result" rejected = ["Exceptions"] reason = "Exceptions hide in sigs. Result forces handling."
aver.toml controls which hosts, paths, and env vars your code can touch. Deployment guardrails.
# aver.toml [effects.Http] hosts = ["api.example.com"] [effects.Disk] paths = ["./data/**"]
Diagnostics built for humans and LLMs — precise, actionable, with hints. See an effect-violation diagnostic rendered live.
Error [3:5]: 'greet' calls 'Console.print' but does not declare the effect. Hint: add ! [Console.print]
aver context exports types, effects, intents — sized to fit an LLM window. Also runs in-browser via the playground Context panel.
$ aver context app.av # Module: Main > "Payment ops entry." effects: [Console, Disk] fn run(cmd) -> Result<Report, String>
Verify blocks state laws the compiler checks and exports to Lean 4 proofs and Dafny lemmas. Effectful functions get proofs too via Oracle — see the randomness paradox or try a pure law in-browser.
verify add law commutative given a: Int = -10..10 given b: Int = -10..10 add(a, b) => add(b, a)
VM for dev, native Rust for production, WASM for browsers. Same source.
$ aver run hello.av $ aver compile hello.av --target rust $ aver compile hello.av --target wasm-gc
The safest code is code that can't go wrong. Aver removes entire categories of bugs by not having the features that cause them.
null
Option<T> with Some / None — the compiler forces you to handle both.
Result<T, E> only — errors are values, never invisible control flow.
if/else
match is exhaustive — the compiler catches every missing case.
?!) for parallelism — explicit, not implicit.
match + TCO. Termination is visible in the structure.
Seven games compiled directly from Aver to WebAssembly GC. Engine handles GC and tail calls — no NaN-boxing, no custom heap. Snake ships at 4.3 KiB; a full roguelike with procedural generation is 25.6 KiB. Modern browsers only (Chrome 119+ / Firefox 120+ / Safari 18.2+).
$ cargo install aver-lang
# hello.av fn greeting(name: String) -> String "Hello, {name}!" fn main() -> Unit ! [Console.print] Console.print(greeting("Aver")) verify greeting greeting("Aver") => "Hello, Aver!"
$ aver run hello.av Hello, Aver!
$ aver verify hello.av All 1 case passed.