Installation
Weir uses Nix with flakes to manage all dependencies. This ensures a reproducible build environment regardless of your system.
Prerequisites
Section titled “Prerequisites”Install Nix with flakes enabled. If you don’t have Nix yet:
# Install Nix (multi-user recommended)sh <(curl -L https://nixos.org/nix/install) --daemon
# Enable flakes (add to ~/.config/nix/nix.conf)experimental-features = nix-command flakesClone and Enter
Section titled “Clone and Enter”git clone <repo-url>cd weirlangActivate the development environment:
nix developThis provides all build tools: Rust toolchain, Cranelift, libffi, pkg-config, and everything else needed to build the compiler.
Verify the Setup
Section titled “Verify the Setup”Build the compiler and run all tests:
just testYou should see all tests pass (currently 647). You can also build the compiler directly:
just buildAvailable Commands
Section titled “Available Commands”Run just to see all available recipes:
| Command | Description |
|---|---|
just build | Build all crates |
just test | Run all tests |
just check | Run clippy, check formatting, and run tests |
just fmt | Format all code |
just run <file> | Run a .weir file |
just tetris | Build and run the OpenGL Tetris demo |
just docs-dev | Start docs dev server |
just docs-build | Build docs site |
Editor Setup
Section titled “Editor Setup”A Zed extension is available at (TODO: Not published yet!) providing:
- Syntax highlighting via tree-sitter
- LSP integration (diagnostics, hover, completion, go-to-definition)
Other Editors
Section titled “Other Editors”The Weir LSP server can be started with:
weir lspAny editor with LSP support can connect to it for diagnostics, completion, hover information, and navigation.