Skip to content

stdx 0.1.0

Choose a tag to compare

@c4milo c4milo released this 15 Nov 13:48
· 21 commits to main since this release

The first release of stdx: compression codecs and JSON for Zig 0.16.0, written from the RFCs. No module allocates or performs I/O; the caller owns every state and buffer, and every call streams and resumes.

What 0.1.0 holds

Module What it holds
deflate, zlib, gzip RFC 1951, 1950 and 1952: decoders, and encoders at levels 1, 6 and 9
zstd RFC 8878 and RFC 9659: a decoder, and an encoder at levels 1 and 3
brotli RFC 7932: a decoder, and an encoder at levels 1 and 5
checksum CRC-32, Adler-32 and XXH64
json RFC 8259 and RFC 7464: an encoder, a pull decoder, and text sequences
base64 RFC 4648's base 64: an encoder and a decoder
platform What the CPU offers, probed once when a program starts
codec The streaming contract every codec shares

Each codec's decoder also sits behind std.Io.Reader, and each encoder behind std.Io.Writer (decision 56).

What the number promises

Decision 65: SemVer 2.0.0. Before 1.0.0, MINOR goes up for any change a dependent can see: a public name, a call's parameters or error set, a state size that grows, the minimum Zig version, or one octet of any encoder's output. PATCH goes up for everything else.

Known limits

  • brotli's level 5 writes more octets than Google's quality 5 on 24 of the 39 corpus rows; its median row is 1.005 of quality 5's size. The work goes on in #8.
  • The published benchmark of design §8 step 15 is not written yet.