Overview
Start here
- Installing Albite
A pre-built binary, a container, or a build from source — and which parts need LLVM.
- About the name
Why the language has a new name, what changed and what did not, and where the old addresses go.
- Hello, world
Your first Albite program — type-checked, interpreted, then compiled to a native binary.
- A short tour
Functions, bindings, conditionals, pattern matching, data types and modules — enough Albite to read real code.
Language
- Values and types
Literals, the built-in types, operators, blocks and the semicolon rule.
- Functions
Declarations, the last-expression rule, early return, lambdas and function types.
- Control flow and pattern matching
if as an expression, match with exhaustiveness checking, nested patterns, if let and let else.
- Data types
Sum types, records, field access, named constructors and record spread.
- Generics
Type parameters on functions and types, how inference works, and generic type aliases.
- Errors and optionality
Option and Result, the ? operator, and try blocks.
- Modules and visibility
Declaring submodules, importing with use, visibility rules and import aliasing.
- Calling C
Declaring external C-ABI functions with extern "C" fn.
- Strictly positive types
A type may refer to itself only to the right of an arrow. The compiler refuses the rest, with E0061.
- Recursion the compiler can see ends
Every recursive function must visibly stop. What E0062 means, and the three ways to satisfy it — including
- Partial definitions in proofs
A theorem may not depend on a
- A recursive type nested inside a generic one
A type whose recursion passes through a generic parameter is accepted, but every match on it is refused with E0064. The fix is a non-generic intermediate type.
Proofs
- Types as propositions
The Curry-Howard correspondence, and what it means for a program to be a proof.
- Writing theorems
The theorem keyword, proof by exhaustive checking, and where that technique stops working.
- Dependent types
Types that depend on values, and what that buys — including where Albite's support currently stops.
- Induction over naturals
The natind eliminator, motives, and proving something about every natural number.
Reference
- Syntax reference
A cheat-sheet for Albite's grammar — declarations, types, expressions and patterns.
- Built-in types and operators
The primitive types, the operator table, conversions, the conventional types and the reserved words.
- Command-line reference
The commands you need to write Albite — check, run, compile, test and explain.
- Current limitations
What Albite cannot do yet, and where the two shipped compilers still disagree.
Try it
- Playground
Write and run Albite in your browser.