Installation
Marrow ships as a single marrow binary plus the QBE backend binary and the std/ sources. All three are bundled together in each GitHub release.
Requirements
Section titled “Requirements”Whatever installation method you use, you will also need a system C compiler available on your PATH:
- Linux / macOS:
cc(or any compiler that responds to theccalias, e.g. GCC or Clang). - Windows:
gcc.
This is required because Marrow does not link executables itself — it generates QBE IL, asks the qbe binary to turn that into assembly, and then shells out to your C compiler to assemble and link the final binary. If no supported C compiler is found for your OS, the compiler will stop after producing the .s assembly file only.
Linux & macOS
Section titled “Linux & macOS”Run the install script. It downloads the right release archive for your CPU architecture, unpacks the marrow and qbe binaries plus the std/ library into ~/.marrow, and appends ~/.marrow/bin to your shell profile’s PATH.
curl -fsSL https://raw.githubusercontent.com/zuygui/marrow/main/install.sh | shWhat it does, concretely:
- Detects your OS (
Linux/Darwin) and architecture (x86_64/aarch64/arm64). - Downloads
https://github.com/zuygui/marrow/releases/latest/download/marrow-<arch>-<platform>.tar.gz. - Installs the binaries to
~/.marrow/bin/marrowand~/.marrow/bin/qbe. - Copies the bundled
std/sources to~/.marrow/std(this is what makes@import("std/...")resolve out of the box — see Modules & imports). - Adds
export PATH="$HOME/.marrow/bin:$PATH"to~/.zshrc,~/.bashrc, or~/.profile(whichever matches your$SHELL).
After it finishes, either restart your terminal or re-source your profile, then check that everything is on PATH:
marrow --versionqbe -hSupported targets
Section titled “Supported targets”The official release archives currently cover:
| OS | Architecture |
|---|---|
| Linux | x86_64 |
| macOS | aarch64 (Apple Silicon) |
If your architecture isn’t published as a release yet, you can always build from source (see below).
Windows
Section titled “Windows”There is a Windows release archive (marrow-x86_64-pc-windows-msvc.zip) published alongside every release, containing marrow.exe, qbe.exe and std/. For now, install it manually:
- Download
marrow-x86_64-pc-windows-msvc.zipfrom the latest release. - Extract it somewhere, e.g.
%USERPROFILE%\.marrow. - Add that folder to your
PATHsomarrow.exeandqbe.exeare reachable. - Make sure
gccis installed and onPATH(e.g. via MSYS2/MinGW-w64) — it’s what Marrow shells out to for the final assemble + link step on Windows.
Building from source
Section titled “Building from source”Marrow’s own compiler is a small Rust (Cargo) project with no external crate dependencies, so building it is a plain cargo build:
git clone https://github.com/zuygui/marrow.gitcd marrowcargo build --release# binary is at target/release/marrowYou’ll also need to build QBE itself, since it’s a separate C project:
git clone git://c9x.me/qbe.gitcd qbemake# binary is at ./qbe — put it on your PATH, alongside marrowFinally, make sure the std/ folder from this repository is discoverable — either copy it to ~/.marrow/std, or keep it next to the source files you’re compiling (see Modules & imports for the exact search order).
Verifying the install
Section titled “Verifying the install”marrow --version# Marrow version: v0.1.0If marrow --version works, move on to Hello World.