ZYL combines the control of C with modern ergonomics. No hidden allocations, true templates, and native LLVM generation.
import std.libc.io : { printf }
import std.arena
struct DynArray!T {
T* data;
int size = 0
void push(DynArray!(T)* self, T val) {
self.data[self.size++] = val
}
T opIndex(DynArray!(T)* self, int idx) {
return self.data[idx]
}
}
int main() {
Arena arena = Arena{}
defer arena.destroy()
arena.create(1024)
int* data = (int*) arena.alloc(sizeof int)
DynArray!int arr = DynArray!int{data}
arr.push(42)
printf("Size: %d\n", arr.size)
printf("data[0] = %d\n", arr[0])
return 0
}
Compiles directly to optimized machine code via LLVM. Manual memory management allows for predictable performance characteristics.
Zero-cost generic programming. Write a `Vector!T` once, and the compiler generates specialized, optimized code for each type used.
Seamlessly call C functions and link with existing libraries. No complex FFI barriers or overhead. Just import and use.
Modern features like optional types, defer, and explicit error handling give you safety without sacrificing low-level control.