* Installation

Installation

There is no package-manager distribution yet. Turf comes either as a standalone pre-built compiler binary (if a release exists for your platform) or as something you build from source. CI currently builds for Linux (x86_64, Arch x86_64), macOS (Apple Silicon and Intel), and Windows (x86_64). Release archives bundle lib/ alongside the binary, so extracting one and running the binary from inside the extracted folder works with no further setup.

Set up TURF_HOME

Every import is resolved against the TURF_HOME environment variable, which should point at the folder that directly contains lib/. You only need this if you move the turf binary somewhere other than where you built or extracted it — running straight from an extracted archive or a fresh source checkout needs no setup at all.

Linux / macOS (add to ~/.zshrc, ~/.bashrc, or ~/.profile):

export TURF_HOME="/path/to/turf-installation"

Windows (PowerShell), persistent for your account:

setx TURF_HOME "C:\path\to\turf-installation"

Compile and run

Once extracted (or built — see below), compile a Turf file (.tr) and run the produced executable:

turf example.tr -o program
./program

Build from source

Requires LLVM 22, CMake 3.20+, and a C++20 compiler. From the turf-lang repo root:

git clone --recursive <this-repo>
cd turf
chmod +x scripts/cmake_build.sh
./scripts/cmake_build.sh --release

llama.cpp (vendored under external/llama.cpp) is built automatically as a static library on first configure if it isn't already built — this can take a while the first time. The resulting binary is placed at build/turf. See Tooling for the full build and test-suite reference.