zust

Zero-cost memory safety for Zig via comptime typestate.
Rust-inspired ownership without runtime overhead.

๐Ÿ›ก๏ธ Compile-Time Ownership

Every ownership transfer is visible in the type system. Double-free and use-after-free are caught at compile time via @compileError.

โšก SIMD Acceleration

16 primitives with 16-byte + 32-byte vector paths. String search, array operations, and bit manipulation are up to 22ร— faster than scalar.

๐Ÿ” Static Analyzer

30 bug class detections including data races, null dereferences, buffer overflows, and cross-function contract violations. Auto-fix generation included.

๐Ÿ”Œ LSP Server

JSON-RPC 2.0 LSP with diagnostics, completion, go-to-definition, hover docs, workspace symbol search, and find-references.

๐Ÿ”„ Safe Mode Transpiler

Convert unsafe Zig to zust-safe Zig via AST rewriting. 20 patterns covering the most common unsafe idioms.

๐ŸŒ Cross-Platform

Native on macOS, Linux, Windows. WebAssembly build for browser IDEs. Cross-compiles to 5 targets.

Installation

Add to your build.zig:

const safe_module = b.addModule("safe", .{
    .root_source_file = b.path("lib/safe.zig"),
});

Then import in your code:

const safe = @import("safe");
var list = safe.ArrayList(i32).init(allocator);
defer list.deinit(allocator);

Or use the adoption scripts for one-command migration.