Getting Started
Install a prebuilt binary
Section titled “Install a prebuilt binary”Development-preview builds of karac are published on the
releases page. Each release
carries self-contained bundles (no LLVM or Rust required on your machine) for:
- Linux x86_64 (
x86_64-linux) - Linux ARM64 (
aarch64-linux) - macOS Apple silicon (
aarch64-macos)
Download the newest tarball for your platform, then:
tar xzf karac-*.tar.gzexport PATH="$PWD/karac-<version>-<platform>/bin:$PATH"karac --versionThe layout is relocatable — karac finds its runtime libraries relative to
its own location, so the unpacked directory can live anywhere. Add the
export PATH line to your shell profile to make it stick.
On macOS, Gatekeeper quarantines downloaded binaries; clear it once after unpacking:
xattr -dr com.apple.quarantine karac-<version>-<platform>karac run (JIT) works out of the box. karac build (native binaries)
additionally needs a C linker — build-essential on Debian/Ubuntu, Xcode
Command Line Tools on macOS. WebAssembly targets (--target=wasm_*) are not
bundled in the preview; build from source for those.
These are pre-v1 preview builds: expect breakage, and report issues with the
exact karac --version string — its +g<sha> suffix pins the commit the
binary was built from.
Build from source
Section titled “Build from source”Alternatively, build karac yourself. You’ll need a
Rust toolchain and, for native compilation, LLVM 18.
git clone https://github.com/karalang/karacd karacargo build --release --features llvm# Runtime archives for `karac build` — lean first, then full (order matters:# both emit the same canonical filename).cargo rustc -p karac-runtime --release --no-default-features --features net --crate-type staticlibcp target/release/libkarac_runtime.a target/release/libkarac_runtime_min.acargo rustc -p karac-runtime --release --crate-type staticlibThe compiler is at target/release/karac; add it to your PATH. See the
repository README for the
full recipe, including the WebAssembly runtime archives.
Hello, world
Section titled “Hello, world”Create hello.kara:
fn main() { println("Hello, world!");}Build and run it:
karac run hello.karaOr compile a native binary:
karac build hello.kara./helloNext steps
Section titled “Next steps”Full language documentation is in progress. Until then:
- Browse the Kāra repository
- See real programs and benchmarks in kara-katas