Repository navigation
Releases
v0.6.0
v0.5.0
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.
v0.4.0
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.
v0.3.0
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.
v0.2.1
Fixed
BoundedWriter: grow the buffer with the same super-linear growth as
ArrayList, 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.
v0.2.0
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'sState
holds 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;lineText
returns 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.SyncCelland
once.SyncLazyadd an atomic fast path and anIo.Mutexfor the first
initialization. -
prefix_map.Map: a compressed radix tree over byte strings, withgetand
getLongestPrefix. Build at comptime withinitComptime, or at runtime with
initanddeinit. A duplicate key is a compile error at comptime and
error.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 like
std.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.doc
and.diagnosticarms. A failed parse fills a caller-ownedDiagnostics
throughParseOptions.diagnostics, which gained the column of the offending
byte. A successful parse leaves that value untouched.
v0.1.0
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.String
takes[]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 andassume
forms.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]:port
config 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.