systems layer / zag

code that
keeps its word.

Zag is a systems language where realtime, noalloc, and pure are checked by the compiler, not just written in a comment and hoped for.

@realtime @noalloc
fn process(buf: []f32) void {
// heap allocation here
list.append(sample);rejected
}
error: noalloc function allocates on line 4
the build stops here, not in production

the guarantees

annotations the compiler enforces.

@realtime

Guarantees a function never blocks in ways that break timing.

@noalloc

Guarantees a function never allocates memory on the heap.

@pure

Guarantees a function has no side effects, checked at compile time.

a comment vs an annotation

they look similar. they aren't.

a comment saying "this never allocates"

trusted until it isn't

@noalloc on the same function

checked on every build

a docstring promising realtime safety

trusted until it isn't

@realtime on the same function

checked on every build

run it yourself

compile and run your first zag file.

get started
$ git clone https://github.com/Sylorlabs/zag
$ cd zag/zag-poc && chmod +x znc bootstrap.sh && ./bootstrap.sh

Want editor support? View Editor Grammar ↗

the foundation under our tools.

Zag grew out of the same low level work that powers Ghost and Zenith. It's early, it's small, and we're building it in the open.

See the Products