Install
Use a complete SDK with bin/, src/, and the tools. Standard-library sources are required to compile imports; placing a renamed compiler on PATH alone does not provide a complete development environment.
Option 1: Instant Browser Sandbox (Zero Install)
Try the Online Playground without installing anything. It runs a WebAssembly subset in your browser through scanning, parsing, borrow checking, and MIR interpretation. For the full native AOT toolchain, install the local SDK below.
Option 2: One-Liner Fast Install (Recommended)
The installer scripts detect the host platform and architecture (x86_64 and ARM64), download the complete SDK, and configure persistent environment variables. Install and uninstall scripts output pure 7-bit ASCII English to avoid terminal mojibake across diverse locales and code pages (such as Windows GBK/CP936):
macOS / Linux (One command in terminal)
# Detects architecture (ARM64 / x86_64), downloads, and configures environment automatically
curl -fsSL https://xulang.org/install.sh | bash -s -- --online --version 0.16.0 --yes
Or download standalone unprivileged CLI installers (self-contained binaries without third-party dependencies) directly from GitHub Releases:
chmod +x xu-setup-linux-x64 && ./xu-setup-linux-x64 -y
Windows (PowerShell or GUI Wizard)
PowerShell One-Liner:
& ([scriptblock]::Create((irm https://xulang.org/install.ps1))) -Online -Version "0.16.0"
Native GUI Wizard:
Download xu-setup-windows-x64.exe or xu-setup-windows-arm64.exe from GitHub Releases and double-click to run the zero-dependency self-rendered wizard. Automatically configures user Path and XU_ROOT.
Option 3: Standalone Native Installers & Offline SDK Archives
For air-gapped environments, enterprise distribution, or explicit version pinning, download the native installer packages directly:
| Operating System | Recommended Package | Details |
|---|---|---|
| Windows | Download xu-v0.16.0-windows-x64-setup.exeor xu-setup-windows-x64.exe(Select windows-arm64 packages for ARM64 machines) |
Self-contained offline installer. Double-click to launch the native GUI wizard (no WebView2 required) or execute .\xu-setup-windows-x64.exe -y in terminal. Automatically configures registry user Path and XU_ROOT. |
| macOS | Download xu-v0.16.0-macos-arm64.pkgor xu-setup-macos-arm64 |
Native macOS GUI package installer. Automatically installs to /usr/local/xu and sets up /etc/paths.d/xu for system-wide availability. Standalone unprivileged xu-setup-macos-arm64 CLI installer is also available. |
| Linux | Download xu-setup-linux-x64or xu-setup-linux-arm64 |
Native binary installer. Run chmod +x xu-setup-linux-x64 && ./xu-setup-linux-x64 -y to automatically extract the SDK and configure Shell profile environment paths. |
Offline SDK Archive Installation
If you downloaded a full SDK archive (.tar.gz on Unix or .zip on Windows) from the Download page or GitHub Releases, the native installer is bundled directly at the root:
# Windows: Double-click xu-setup.exe in File Explorer, or in terminal:
.\xu-setup.exe -y
# macOS / Linux: Run xu-setup directly in the extracted directory:
./xu-setup -y
The default is the existing SDK selected by PATH, otherwise ~/.xu (macOS .pkg defaults to /usr/local/xu). Use --prefix /custom/path to customize the target directory. In automated CI pipelines, use ./xu-setup --yes or .\xu-setup.exe --yes to install all tools; for temporary evaluation, run source env.sh (or . .\env.ps1 in PowerShell).
Verify Global Environment
After installation, open a new terminal window (CMD, PowerShell, Terminal, or VS Code integrated terminal) and verify that the toolchain is globally active:
xu --version
xu env
xu doctor
Targets
| System | --target | Default artifact | Details |
|---|---|---|---|
| macOS | macos-arm64, macos-x64 | Mach-O, no suffix | Apple Silicon and Intel architectures |
| Linux | linux-arm64, linux-x64, linux-loongarch64, linux-riscv64 | ELF, no suffix | Mainstream servers, LoongArch, and embedded Linux |
| Windows | windows-x64, windows-arm64 | PE, .exe | 64-bit x86 and ARM64 native executables |
| WebAssembly | wasm32-wasi | Wasm binary, .wasm | WASI Preview 1 runtimes |
| Bare metal | thumbv7em-none, riscv32imac-none | Bare-metal firmware binary | OS-less embedded microcontrollers |
A supported target does not imply a published SDK asset or support for every library and desktop feature. See Status & Limitations.
Upgrade, reinstall and repair
Run the installation command above again to upgrade or repair the current SDK, including an old updater's version mismatch or an interrupted installation. Setup stages the complete SDK on the same filesystem, verifies every inventoried file and all ten tools, then replaces the directory. It prints the retained original SDK backup path. User data outside managed SDK components is preserved.
Choose a destination with Unix --prefix /path/to/xu or PowerShell -Prefix "C:\Tools\Xu". Its parent must be writable; a system installation may require administrator privileges. To leave terminal configuration untouched, use Unix --no-modify-path, PowerShell -NoModifyPath, or native Setup --no-modify-path.
xu --version
xu env
xu update --check
# Once 0.10.7 or later is installed:
xu update
# Reinstall the current version and repair the full SDK:
xu update --force
Setup and xu update share the complete SDK replacement process, including tools, standard library, packages, examples and editor files. Use xu update --version <version> to select a release. See release history for version changes.
Verify compilation
xu check hello.xu
xu run hello.xu
xu build hello.xu --output hello
macOS / Linux executables already have execute permission. In PowerShell, prefer --output for output paths.
Environment and source builds
XU_ROOT selects the SDK or compiler checkout; XU_STDLIB_ROOT explicitly selects its src/. XUPATH adds search roots and does not replace external-module require: declarations. Keep xu-fmt, xu-doc, xu-map, xu-doctor, xu-desktop, and xu-lsp beside xu in bin.
Sources are in the xu repository. make xu self-hosts with an existing hosted product seed and rebuilds the tools. A clean checkout requires a product seed and the bootstrap companion repository first. packages, examples, and vscode-xu are maintained separately.