Almide is a statically-typed language for code that AI writes and edits. The claim is not that the model gets it right. It is that when the model is wrong, the compiler says so at author time and names the fix. Programs compile to native binaries (via Rust) and to WebAssembly, with byte-identical output on every contracted behaviour. almide verify checks the ownership, bounds, name and capability witnesses of the wasm module almide build ships, pinned to that file by its SHA-256 (what is proven, what is trusted).
Almide at a glance
type Order = { item: String, qty: Int, price: Int }
fn parse(line: String) -> Order? = match line |> string.trim |> string.split(",") {
[item, qty, price] => match (int.parse(qty), int.parse(price)) {
(ok(q), ok(p)) => some({ item: item, qty: q, price: p }),
_ => none,
},
_ => none,
}
fn main() -> Unit = {
let csv = """
apple,3,120
pear,oops,90
plum,5,80
"""
let orders = csv |> string.lines |> list.filter_map(parse)
let total = orders |> list.fold(0, (sum, o) => sum + o.qty * o.price)
println("${list.len(orders)} orders, total ${total}")
}
2 orders, total 760
The row with a bad number falls through to none and is skipped: no exception and no unwrap, and a match that forgets a case doesn't compile. The same program prints the same bytes natively and on wasm, and this file runs in CI as examples/order-total.almd.
An edit that survives
A model adds a case to a type and, as models do, touches nothing else:
type Shape =
| Circle(Float)
| Square(Float)
| Triangle(Float, Float) // the edit
fn area(s: Shape) -> Float =
match s {
Circle(r) => 3.14159 * r * r
Square(w) => w * w
}
error[E010]: non-exhaustive match: missing Triangle(_, _)
--> shape.almd:7:9
in match
here: match s {
hint: add arms for Triangle(_, _):
Triangle(arg1, arg2) => _
Or use `_ => todo()` to compile incrementally.
The diagnostic is the fix: the model's next turn is Triangle(b, h) => 0.5 * b * h, and the program then prints the same bytes natively and on wasm. The same question asked against Python, on eight injected modification mistakes: demo/make-verify.
Install the GitHub CLI (gh) first: the default installer verifies the release attestation and refuses installation without it. See SECURITY.md for verification details.
curl --proto '=https' --tlsv1.2 -fsSL https://raw.githubusercontent.com/almide/almide/main/tools/install.sh | sh # macOS / Linux
irm https://raw.githubusercontent.com/almide/almide/main/tools/install.ps1 | iex # Windows (PowerShell)
The installer checks the archive against the release's almide-checksums.sha256; every release asset is Sigstore-attested (SECURITY.md shows how to verify one). Each archive also carries almide-verify, the certificate checker almide verify hands its witnesses to. From source, with Rust 1.97+: make install.