v0.5.0 “Differentiation” · QBE-backed · self-hosted

Down to
the marrow.

Marrow is a small, explicit systems language that compiles straight to native code through QBE. No garbage collector. No hidden runtime. Memory is owned and checked at compile time — if your program allocates, it's because you told it to.

hello.mw
@import("std/std.mw")

@export fn main() {
    println("Hello from Marrow !");
}
terminal
$ marrow hello.mw
Compilation successful! Executable created at: hello
$ ./hello
Hello from Marrow !
Built for control

What you write is what runs.

No hidden runtime

No garbage collector, no implicit allocations, no hidden control flow. Every allocation traces back to a function you called.

C-friendly, libc-free

@extern calls any C function directly, yet the standard library itself needs no libc: it talks to the OS through a small platform layer.

QBE-backed codegen

A small compiler, written in Marrow, emits textual QBE IL, then shells out to qbe and your system C compiler for real, native binaries.

Ownership, no GC

^T owns, &T and &mut T borrow. Moves, borrows and drops are checked at compile time; unsafe is explicit.

From source to silicon

A short, readable compiler.

Six plain stages, each its own module — no macro-expansion phase, no hidden optimizer. Types, ownership and borrows are checked before a single line of IL is emitted.

LexerSource text → tokens
ParserTokens → AST
ImportsFlattens the module graph
CheckTypes, ownership, borrows
CodegenAST → QBE IL
QBE + ccIL → native binary
Read about the pipeline in full →
Benchmarks

Quick to build. Measured honestly.

The same six programs written in Marrow, C, Rust and Go: how long each toolchain takes to build them, and how fast the result runs. Real numbers from benchmarks/run.py — including the ones where Marrow doesn't win.

Recursive Fibonacci

compile time · milliseconds, median of 15 (lower is better)

gcc -O013.3.0
31msfastest
Marrowv0.5.0
33ms
clang -O218.1.3
57ms
gcc -O213.3.0
58ms
rustc -O1.97.0
103ms
go build1.24.7
156ms

Sieve of Eratosthenes, 5M

compile time · milliseconds, median of 15 (lower is better)

gcc -O013.3.0
36msfastest
Marrowv0.5.0
36ms
gcc -O213.3.0
41ms
clang -O218.1.3
70ms
rustc -O1.97.0
130ms
go build1.24.7
158ms

Longest Collatz chain below 1M

compile time · milliseconds, median of 15 (lower is better)

gcc -O013.3.0
33msfastest
Marrowv0.5.0
34ms
gcc -O213.3.0
48ms
clang -O218.1.3
63ms
rustc -O1.97.0
118ms
go build1.24.7
169ms

Mandelbrot, 400x400, f64

compile time · milliseconds, median of 15 (lower is better)

gcc -O013.3.0
36msfastest
Marrowv0.5.0
36ms
gcc -O213.3.0
43ms
clang -O218.1.3
69ms
rustc -O1.97.0
112ms
go build1.24.7
160ms

Quicksort of 1M integers

compile time · milliseconds, median of 15 (lower is better)

Marrowv0.5.0
40msfastest
gcc -O013.3.0
42ms
gcc -O213.3.0
56ms
clang -O218.1.3
89ms
rustc -O1.97.0
167ms
go build1.24.7
180ms

200x200 matrix product, f64

compile time · milliseconds, median of 15 (lower is better)

Marrowv0.5.0
43msfastest
gcc -O013.3.0
46ms
gcc -O213.3.0
54ms
clang -O218.1.3
90ms
rustc -O1.97.0
153ms
go build1.24.7
158ms

Recursive Fibonacci

run time · milliseconds, median of 7 (lower is better)

gcc -O213.3.0
18msfastest
clang -O218.1.3
26ms
rustc -O1.97.0
28ms
Marrowv0.5.0
31ms
go build1.24.7
46ms
gcc -O013.3.0
62ms

Sieve of Eratosthenes, 5M

run time · milliseconds, median of 7 (lower is better)

gcc -O213.3.0
27msfastest
Marrowv0.5.0
27ms
go build1.24.7
29ms
clang -O218.1.3
30ms
rustc -O1.97.0
30ms
gcc -O013.3.0
52ms

Longest Collatz chain below 1M

run time · milliseconds, median of 7 (lower is better)

clang -O218.1.3
178msfastest
rustc -O1.97.0
181ms
gcc -O213.3.0
235ms
go build1.24.7
285ms
Marrowv0.5.0
312ms
gcc -O013.3.0
449ms

Mandelbrot, 400x400, f64

run time · milliseconds, median of 7 (lower is better)

rustc -O1.97.0
9msfastest
clang -O218.1.3
11ms
go build1.24.7
11ms
gcc -O213.3.0
13ms
Marrowv0.5.0
18ms
gcc -O013.3.0
25ms

Quicksort of 1M integers

run time · milliseconds, median of 7 (lower is better)

gcc -O213.3.0
87msfastest
clang -O218.1.3
103ms
go build1.24.7
114ms
Marrowv0.5.0
114ms
rustc -O1.97.0
123ms
gcc -O013.3.0
154ms

200x200 matrix product, f64

run time · milliseconds, median of 7 (lower is better)

clang -O218.1.3
3msfastest
rustc -O1.97.0
3ms
gcc -O213.3.0
6ms
go build1.24.7
7ms
Marrowv0.5.0
11ms
gcc -O013.3.0
29ms

Intel Xeon @ 2.10GHz, 2 cores · one compiler invocation producing an executable · Compile: 1 warm-up, median of 15 runs, unique source each run so nothing is cached. Run: median of 7 executions of the compiled program.

reproduce →

Build: Marrow is about as fast as gcc -O0, quicker than gcc -O2 and clang -O2, and about four times quicker thanrustc and go build; most of its time is qbe and the system assembler and linker. Run: the code QBE emits beats gcc -O0 and lands in the range of Go, behind optimizing compilers (small functions are inlined, but there are no loop optimizations yet). These are small programs on a 2-core VM: read the ratios, not the digits.

A standard library you can read

Batteries included. No libc underneath.

Every module is written in Marrow itself, on top of a small platform layer (Linux, macOS, Windows). From io to JSON and HTTPS, owned values free themselves.

Where things stand

Early, and honest about it.

Marrow compiles itself: the compiler is written in Marrow and bootstraps to a fixed point. The original Rust compiler lives on in the v1 branch.

Working today

  • Self-hosted compiler, bootstrapping to a fixed point
  • Ownership, moves, borrows and automatic drop
  • Hook structs (@drop) as owning values, nested or not
  • Methods (impl) and single inheritance
  • Libc-free standard library: files, JSON, HTTPS and more
  • Packages, tests, formatter, docs generator and language server
  • Cross-compilation to Linux, macOS and Windows

In progress

  • Faster generated code (loop optimizations)
  • Faster, more incremental builds
  • Growing the standard library
  • Windows install tooling

One command away.

Installs the marrow and qbe binaries, plus the standard library, to ~/.marrow.

curl -fsSL https://raw.githubusercontent.com/zuygui/marrow/main/install.sh | sh
macOS, Windows & building from source →