Installing Albite
There are three ways to get a working albite. Which you want depends mostly
on whether you need native compilation, because that is the only part that
requires LLVM.
Type checking (
albite check) and interpreted execution (albite run) work without LLVM. Onlyalbite compile, which produces a native binary, needs LLVM 18.
Pre-built binaries
Binaries for macOS (ARM64) and Linux (x86_64) are attached to each
release. The
current one is the pre-release
v2.0.0-beta.3
(what is in it); GitHub lists it under Pre-release
rather than Latest.
Each archive holds albite, libalbite_core.a (which albite compile
links into every program it builds), the examples/ directory, the README and
the licence. On macOS, albite is the self-hosted compiler and
albite-bootstrap beside it is the Rust one; on Linux, albite is the
Rust bootstrap, and the archive adds the Docker wrapper described below. Each
archive also carries the language’s former command name, which forwards to
albite — see About the name.
On macOS, reach for albite-bootstrap when the two disagree. The
self-hosted compiler does not yet parse tactic proofs, record spreads or
turbofish, and its interpreter has three known faults; Current
limitations lists them. Every example in this
manual except the tactic proof runs on both.
The macOS binaries are not code-signed, so macOS will refuse to run them until you clear the quarantine attribute:
xattr -d com.apple.quarantine albite albite-bootstrap
Each release includes a checksums.txt you can verify against:
shasum -a 256 -c checksums.txt
The Linux binary is x86_64 and needs glibc 2.39 or newer — Ubuntu 24.04 and up. On an older distribution, or on a non-x86 host such as an Apple Silicon Mac, use the container instead.
Container
The repository ships a Docker wrapper, which is the least fussy option if you want native compilation without installing LLVM yourself:
./albite-docker.sh build # first run only
./albite-docker.sh run check myfile.tg
./albite-docker.sh run compile hello.tg -o hello
./albite-docker.sh run run examples/hello.tg
./albite-docker.sh shell # interactive
Building from source
You need a Rust toolchain. Without LLVM you get check, run, and eval:
cargo build --release -p albite_bootstrap --no-default-features
./target/release/albite run examples/hello.tg # → "hello world"
./target/release/albite check examples/arithmetic.tg
./target/release/albite eval "2 + 2" # → 4
Adding LLVM 18 gets you compile:
# macOS with Homebrew; point at your own llvm@18 prefix elsewhere.
LLVM_SYS_180_PREFIX=$(brew --prefix llvm@18) cargo build --release
./target/release/albite compile examples/hello.tg -o hello
./hello # → hello world
The repository’s Makefile wraps the common paths:
make run FILE=examples/hello.tg # interpreted, no LLVM
make compile FILE=examples/hello.tg OUT=hello # native, needs LLVM 18
make compile-run FILE=examples/hello.tg # both in one step
Checking it works
albite check examples/hello.tg
should print a line confirming one definition, all OK. If it does, carry on to Hello, world.
The browser playground
The examples on these pages check and run in your browser, and the
playground takes code of your own. Both use the bootstrap
compiler from v2.0.0-beta.3, built for the browser: it type-checks and runs
programs, tactic proofs included, but does not compile them to a native
binary — for that, install albite. With JavaScript off, the examples are
static: copy them into a file and run them with the albite you install.