Download rok
Install script
macOS and Linux:
curl -fsSL https://rok-lang.org/install.sh | sh
Windows, in PowerShell:
powershell -ExecutionPolicy Bypass -c "irm https://rok-lang.org/install.ps1 | iex"
The script picks the archive for your machine, checks its SHA-256 and unpacks it into ~/.rok (Windows: %USERPROFILE%\.rok). install.sh --version <v> and install.ps1 -Version <v> pick another release.
Archives
Each archive has a .sha256 beside it. Check it, then install from the archive:
shasum -a 256 -c rok-0.1.0-aarch64-apple-darwin.tar.xz.sha256
sh install.sh --archive rok-0.1.0-aarch64-apple-darwin.tar.xz
The .tar.xz is about half the size of the .tar.gz; on Linux, tar needs xz to unpack it. An unpacked archive also installs itself with its own install.sh (Windows: install.ps1).
Writing a compiler plugin? Each release also ships a rok-mlir-dev-0.1.0-<triple> bundle, with the MLIR and LLVM headers and rokc's import library, on the releases page; see MLIR plugins.
Cross-compilation targets
You download one archive for your own machine; it builds for the rest. Every release archive carries the runtime and linker for these targets, so rok build --target <triple> (or --target on rok run) produces a binary for any of them without anything more to install:
| Target | Triple |
|---|---|
| Linux x86_64, glibc 2.34+ | x86_64-unknown-linux-gnu |
| Linux arm64, glibc 2.34+ | aarch64-unknown-linux-gnu |
| Linux x86 (32-bit), glibc 2.34+ | i686-unknown-linux-gnu |
| Linux armv7 hard-float, glibc 2.34+ | armv7-unknown-linux-gnueabihf |
| Linux riscv64, glibc 2.34+ | riscv64gc-unknown-linux-gnu |
| Linux x86_64, static (musl 1.2.5) | x86_64-unknown-linux-musl |
| Linux arm64, static (musl 1.2.5) | aarch64-unknown-linux-musl |
| Windows x86_64 | x86_64-pc-windows-msvc |
| Windows arm64 | aarch64-pc-windows-msvc |
| Windows x86 (32-bit) | i686-pc-windows-msvc |
| WebAssembly, WASI preview 2 | wasm32-wasi |
| WebAssembly, WASI with threads | wasm32-wasi-threads |
| WebAssembly, browser / freestanding | wasm32-unknown-unknown |
The macOS archive adds aarch64-apple-darwin and x86_64-apple-darwin (they link against the Xcode Command Line Tools SDK, so only a macOS host builds them). These are the targets a release ships a runtime and linker for, so they build with nothing more installed; rokc --print target-list also lists the other triples the code generator knows, for which you supply the runtime yourself.
What else you need
- macOS: the Xcode Command Line Tools (
xcode-select --install), for the SDK that linking needs. - Linux: nothing; glibc 2.34 or later (Ubuntu 22.04, Debian 12, RHEL 9 and newer).
- Windows: nothing.
Other hosts, such as Intel Macs and Windows on arm64, have no release archive yet: build rok from source. Every release, with its notes, is on GitHub. Next: Getting started.