Albite

Albite

formerly Tungsten by Spinning Cat Studios

A dependently typed language that proves what it computes. Write programs and the theorems about them in one language, and let the compiler check both.

The compiler checks the claim

The type of _p says that a one-element list has length 1, for every n. The compiler evaluates length to decide it, and the program does not build if the claim is false.

type List = Nil | Cons(Nat, List)

fn length(l: List) -> Nat {
    match l {
        Nil => 0,
        Cons(h, t) => 1 + length(t),
    }
}

fn length_of_one(n: Nat) -> Unit {
    let _p: Eq<Nat, length(Cons(n, Nil)), 1> = refl;
    ()
}

Try it in your browser

The playground runs the compiler's checker in a Web Worker. Nothing to install.

Open the playground

Questions

Is it ready for production?
Not yet. The 2.0 releases are previews, and the roadmap says what is left.
Do I need to know type theory?
No. Start with ordinary programs; the proof features are there when you want them.

More questions →