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.9 · 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.
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.
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.
$ aver context app.av # Module: Main > "Payment ops entry." effects: [Console, Disk] fn run(cmd) -> Result<Report, String>
Verify blocks export to Lean 4 proofs and Dafny lemmas. Specs become machine-checked.
-- Generated Lean 4: example : fromString "[1,2]" = Except.ok (jsonList [jsonInt 1, jsonInt 2]) := by native_decide
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
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 standalone WASM. No emscripten, no GC, tiny inline runtime. Snake is 6.0 KiB. A full roguelike is 29.2 KiB.
$ 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.