Zig implementation of the Recurram wire format and session-aware encoder/decoder.
This repository tracks the Recurram v2 release line.
- Dynamic encoding/decoding (
encode,decode) - Schema-aware encoding (
SessionEncoder.encodeWithSchema) - Batch encoding (
SessionEncoder.encodeBatch) - Session table behavior (key/string interning, shape promotion, reset controls)
- Vector codecs (Simple8b, RLE, FOR/direct bitpack, XOR float, and plain)
- Zig 0.15.2 (minimum
0.15.0)
const std = @import("std");
const recurram = @import("recurram");
pub fn main() !void {
const allocator = std.heap.page_allocator;
var entries = try allocator.alloc(recurram.model.ValueMapEntry, 2);
entries[0] = .{ .key = try allocator.dupe(u8, "id"), .value = .{ .U64 = 1001 } };
entries[1] = .{ .key = try allocator.dupe(u8, "name"), .value = .{ .String = try allocator.dupe(u8, "alice") } };
var value = recurram.Value{ .Map = entries };
defer value.deinit(allocator);
const bytes = try recurram.encode(allocator, &value);
defer allocator.free(bytes);
var decoded = try recurram.decode(allocator, bytes);
defer decoded.deinit(allocator);
std.debug.assert(recurram.Value.eql(decoded, value));
}Run checks locally:
zig fmt build.zig build.zig.zon src tests
zig build testRust client interop smoke check (Zig server -> Rust client):
bash scripts/check-rust-client-interop.shZig client interop smoke check (Rust server -> Zig client):
bash scripts/check-zig-client-interop.shRun both directions:
bash scripts/check-interop.shNote: these scripts expect ../recurram-rust to exist as a sibling directory.
- CI workflow:
.github/workflows/ci.ymlzig fmt --checkzig build test
- Release workflow:
.github/workflows/publish-release.yml- Triggers on
v*tags or manual dispatch - Verifies tag/version match against
build.zig.zon - Re-runs checks and publishes a GitHub Release
- Triggers on
Release steps:
- Bump
.versioninbuild.zig.zon. - Create and push matching tag
v<version>.
Example:
git tag v0.1.0
git push origin v0.1.0This project is licensed under the MIT License - see the LICENSE file for details.