Changelog
Unreleased
Added
hash.crc32c: CRC-32C (Castagnoli), one-shot withhashand resumable from a stored digest withappend. SSE4.2 on x86-64, the ARMv8 CRC instructions on aarch64, and slice-by-16 tables elsewhere, picked from the target at compile time.count_min: fixed-capacity Count-Min Sketches (Sketch,Custom,Auto,String) with comptime sizing by explicit dimensions orConfig.fromError, saturating counters,addConservative,merge, andhalve.cuckoo: fixed-capacity Cuckoo filters (Filter,Custom,Auto,String) with deletion,u8/u16/u32fingerprints, SIMD 4-slot bucket probing, and full rollback onerror.FilterFull.ultraloglog: UltraLogLog distinct-count sketches (Sketch,Custom,Auto,String) in[1 << precision]u8storage, with the Optimal FGRA estimator,merge, losslessdownsize, and validatedasBytes/fromBytes.wire:Reader.peek,peekSlice, andpeekUntilreturn what the read forms would and leave the cursor alone, so a decoder can route on a tag or test a delimiter before it commits.wire: LEB128 varints.Writer.appendLeb128andReader.readLeb128take the sign from the type, so an unsigned type writes ULEB128 and a signed one writes SLEB128.readLeb128returnserror.Overflowfor an encoding that does not fit its type anderror.UnexpectedEoffor a missing terminator, and a failed read leaves the cursor where it was.wire:appendandreadtake a packed struct as its backing integer, so a flags byte or a bitfield has one store and no padding.wire:Writer.appendSliceEndianandReader.readSliceEndianwrite and read a run of integers or packed structs in the byte order, whereappendSlicewould copy bytes.readSliceEndianfills a buffer the caller owns.wire:Writer.undodrops the lastnbytes from the output, for a field the caller writes and then decides against.
0.6.0 - 2026-11-16
Changed
- stdx builds with Zig 0.17.
minimum_zig_versionis0.17.0, and the 0.16 compatibility lane and source shims are gone.
0.5.0 - 2026-11-13
Added
base64: RFC 4648 encoding and decoding, with a comptime codec (standard,standard_no_pad,url_safe,url_safe_no_pad) over caller-owned bytes.decodevalidates padding and the unused trailing bits. The kernel is picked from the target CPU at compile time: NEON on aarch64, AVX2 onx86_64_v3, AVX-512 VBMI onx86_64_v4. A build for the x86-64 baseline falls back tostd.base64. No CPUID probe and no run-time dispatch: build with the target you want.fmt.atoi:Optionsgainsplus_signandnegative_zero..plus_sign = .rejectmakes"+1"anerror.InvalidCharacter, and.negative_zero = .rejectdoes the same for"-0". Both default to today's behavior.intern:intern.Poolkeeps one copy of each string in chunk storage and hands out denseu32ids.intern,lookup,get, anddeinittake the allocator, and an id stays valid untildeinit.slot:slot.Pool(Entry, prev_field, next_field)is a fixed-capacity pool over a caller-owned entry slice, andslot.Array(Entry, prev_field, next_field, n)owns its entry array for a comptime capacity. The two link fields live in the entry, and their unsigned integer type is the handle type.acquire,acquireFront,release,get,isLive,moveToFront,popFront, andpopBackare O(1), anditeratorwalks the live entries front to back.swiss:rehashrebuilds the table at its current bucket count and clears every tombstone. Use it on a long-lived map that removes entries without growing. Pointers into the table are invalidated.time.Timestamp:Timestamp.now(clock)reads a clock into the compact value with no error union, so a field takes a decl literal.Timestamp.elapsed(clock)returns theDurationto a fresh reading, and rejects.realat compile time because wall time can step backwards.wire:Reader.readUntil(delimiter)returns the bytes before a delimiter and consumes it, for a field with no length prefix. A missing delimiter iserror.UnexpectedEof, and the cursor does not move.
0.4.0 - 2026-11-12
Added
posix.OptionalFd: an optional POSIX descriptor in four bytes.nonestores-1, andgetis explicitly inlined. The value carries no ownership.- Compact time values provide
fromNanosecondsComptime,fromMicrosecondsComptime,fromMillisecondsComptime, andfromSecondsComptime. These return plain values and reject out-of-range values at compile time. Optional values expose the same constructors without a sentinel ortrystep. time.Durationandtime.Timestamp: nonnegative nanosecond values in eight bytes, with checked arithmetic and lossless conversion to the wider std values.time.OptionalDurationandtime.OptionalTimestamp: eight-byte optional values.noneuses the highestu64value without a separate tag.
0.3.0 - 2026-11-02
Changed
- stdx builds with Zig 0.16 and 0.17.
minimum_zig_versionstays0.16.0, and CI runs the Debug, ReleaseSafe, and ReleaseFast suites on both.
0.2.1 - 2026-11-01
Fixed
BoundedWriter: grow the buffer with the same super-linear growth asArrayList, clamped tolimit, instead of to the exact size of each write. Byte-at-a-time writes no longer reallocate and copy the whole buffer per byte.BoundedWriter: awriteSplatcall with a splat count of zero drops the final pattern as specified and no longer copies it into the buffer first.
0.2.0 - 2026-10-31
Added
-
heap.Bump(.{ ... }): a single-threaded bump arena over chunks from a child allocator, with the chunk sizes fixed at comptime.allocator()hands out anAllocatorwith no atomics,freeis a no-op, anddeinitreleases every chunk.reset(.retain_capacity)keeps the chunks for the next job, and a request abovemax_chunkgets a chunk of its own size. The type'sStateholds only the chunk list and the cursor, for a struct that stores an arena and gets copied. -
jsonc: read JSON with//and/* */comments and a trailing comma.scrubandscrubInPlaceblank the comments and the comma to spaces and keep every byte offset, sostd.jsonparses the copy and reports the caller's line and column.parseFromSlicereturns a value that owns the scrubbed copy. -
dotenv.parse: a.envparser with one documented grammar. Keys match[A-Za-z_][A-Za-z0-9_]*, anexportprefix is accepted, and comments and the three quoting forms follow one set of rules. Key and value slices are borrowed from the caller's source, except the escape bytes of a double-quoted value, which go into a caller-owned scratch buffer. A bad line returnsErrorand fills theDiagnosticsthe caller passed;lineTextreturns that line. Duplicate keys are kept in order andDoc.getreturns the last. No variable expansion. -
lru.Custom,lru.Auto, andlru.String: a fixed-capacity LRU cache.getandpeek;putreturns the replaced value or the evicted entry;remove,popLru,popMru, an iterator, andclear. No allocator and no eviction callback. -
fmt.parseBool: the boolean spellings of Go'sstrconv.ParseBool(1,t,T,TRUE,true,True, and the false set). Returns null for anything else. -
sort.radix: a stable LSD radix sort for signed and unsigned integers, with a caller-owned scratch slice.sort.nthandsort.selectpartition a slice around the n-th element with a 3-way quickselect and a depth fallback. -
once.Cellandonce.Lazy: a value set at most once, withget,getOrInit,getOrTryInit,set, andtake.once.SyncCellandonce.SyncLazyadd an atomic fast path and anIo.Mutexfor the first initialization. -
prefix_map.Map: a compressed radix tree over byte strings, withgetandgetLongestPrefix. Build at comptime withinitComptime, or at runtime withinitanddeinit. A duplicate key is a compile error at comptime anderror.DuplicateKeyat runtime. -
enums.Openandenums.Closed: turn a comptime list of byte strings into an enum, then switch on the tags.Openis non-exhaustive with an unnamed miss value and anelsearm.Closedadds a named fallback tag and is exhaustive.enums.stringToEnummatches enum field names likestd.meta.stringToEnum, with fixed-length loads. -
set.Custom,set.Auto, andset.Stringexposecapacity, the bound every other fixed-capacity container already publishes. -
btreeandlrugaininit: a value with a default-initialized context, besideempty(undefined context) andinitContext(caller's context).priority_queuekeepsemptyandinitContext, because its usual context isvoid, which has no default to initialize.lru.PutResult.emptyis the result of a put that replaced and evicted nothing.
Changed
-
Public structs no longer accept a bare
.{}. A value type names its constructor (init,empty,zero, ordefault) and requires every field, sobtree.Iterator,slot_ring.Lease,stdio.Stream,time.RateLimit,jsonc.Diagnostics, andlru.PutResultlost their field defaults. A struct literal must now set every field; use the constructor. Options bags (jsonc.Options,dotenv.ParseOptions) keep their defaults, runtime or comptime: a call site overrides one knob and leaves the rest. -
net.Ip4.parsetakes a fixed-window SWAR fast path for canonical dotted quads. On a 1M-address random corpus the fast path measured 6.8 ns per address against 15.2 ns for the std parser. Results, the error set, and non-canonical behavior are unchanged; anything the fast path rejects goes through the std parser. -
dotenv.parsereturnsError!Docinstead of aResultunion with.docand.diagnosticarms. A failed parse fills a caller-ownedDiagnosticsthroughParseOptions.diagnostics, which gained the column of the offending byte. A successful parse leaves that value untouched.
0.1.0 - 2026-10-26
The first release. Everything the guide documents ships here.
Added
stdx: extensions to the Zig 0.16 standard library, as one module with a namespace per idea: fixed-capacity containers, a resizable Swiss hash map, the orderedbtree, strict parsing, a forward-onlywireformat, base32, IPv4 and CIDR prefixes, UUIDs, timekeeping, a caller-driven timer set, an MPSC log ring, and the small pieces (BoundedWriter,hash.RapidHash, the heap pools,membyte values, secure random, and buffered stdio).btree: an ordered map.btree.Autotakes integer keys,btree.Stringtakes[]const u8keys, andbtree.Customtakes any key type with a comparison context. Iteration is in key order.lockPointersmakes an insertion or removal that invalidates a held pointer assert in Debug and ReleaseSafe.wire.Reader(.big)andwire.Reader(.little): forward-only decoding of caller-owned bytes, the inverse ofwire.Writer, with checked andassumeforms.time.writeRfc3339: UTC RFC 3339 text with the fractional width fixed at comptime, from.secondsthrough.nanoseconds.net.HostPort.parse: splithost,host:port,[host], and[host]:portconfig text with a default port.bit_set.Scratch(capacity): a fixed-capacity bitset for reused workspaces; reset clears only the validity map.heap.SizeClassPool: a fallible byte pool over caller-owned storage, with per-class live accounting.