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. Your programs don’t need libc: with --nostdlib the C compiler is used purely as an assembler and linker (see Targets & cross-compilation). To only type-check (marrow check) you need neither qbe nor a C compiler.
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”The compiler is written in Marrow, so building it needs no other Marrow compiler. The repository carries a seed (assembly for each supported platform in bootstrap/): bootstrap.sh assembles it, uses the result to compile the compiler’s sources, then compiles them again. The last two generations must be identical (a fixed point), and only then is build/marrow produced.
git clone https://github.com/zuygui/marrow.gitcd marrow./bootstrap.sh# the compiler is at build/marrowbootstrap.sh needs cc (gcc on Windows/MSYS2), qbe and gzip. QBE is a separate C project, so build it first if you don’t have it:
git clone https://c9x.me/git/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, keep it next to the source files you’re compiling, or leave it next to the marrow binary (see Modules & imports for the exact search order).
After changing the compiler or the standard library, ./bootstrap.sh --update-seed regenerates the seeds. The earlier compiler written in Rust is kept on the v1 branch.
Verifying the install
Section titled “Verifying the install”marrow --version# Marrow version: v0.1.0If marrow --version works, move on to your first program.
Run marrow doctor to check that qbe and a C compiler can be found. It tells you what is missing.
Packages need nothing else
Section titled “Packages need nothing else”Downloading dependencies (marrow add, marrow install) does not need git: packages come as archives over HTTPS. git is only a fallback for local and SSH repositories and is used by marrow publish. See Packages.