Standard library — the modules ZZ ships with
Batteries included: HTTP, JSON, fs, math, SQL, crypto, regexp, concurrency.
All fallible ops return Result<_, str> with module:op:code: detail messages,
identical on VM and AOT.
Module index
Section titled “Module index”| Module | Purpose | Doc |
|---|---|---|
| built-ins | println, len, range, map, int, clone, dbg |
Built-ins |
std.str |
string manipulation, byte offsets | String |
std.vec |
generic array operations | Vector |
std.bytes |
contiguous byte buffers | Bytes |
std.map |
dict helpers: safe lookup, merge | Map |
std.set |
set helpers over arrays | Set |
std.dec |
exact decimal math on strings | Decimal |
std.json |
parse/stringify/get/as_* | JSON |
std.csv |
RFC4180 subset | CSV |
std.property |
seeded generators + shrinking | Property |
std.colors |
ANSI styling, truecolor, 256-color | Colors |
std.crypto |
digests, HMAC, CSPRNG, passwords, signatures, JWT | Crypto |
std.encoding |
base64, hex, URL codecs | Encoding |
std.uuid |
v4/v7 generation, parse, validate | UUID |
std.log |
levels, sinks, spans | Log |
std.sys |
infallible machine info | Sys |
std.term |
raw mode, single-key reads, size | Term |
std.args |
argv + flag parser | Args |
std.env |
environment, cwd, args | Env |
std.process |
run/spawn external processes | Process |
std.fs |
filesystem, providers, streaming | FS |
std.path |
pure lexical path helpers | Path |
std.http |
server + client | HTTP |
std.net (+ tls/unix) |
TCP networking | Net |
std.cell |
shared-mutable slots | Cell |
std.regexp |
compiled patterns | Regexp |
std.sqlz (+ postgres/mysql) |
SQLite + wire drivers | SQL |
std.chan |
unbounded channels | Chan |
std.task |
spawn and join green threads | Task |
std.test |
asserts, temp dirs, snapshots | Test |
std.math |
numerics, constants | Math |
std.time |
clocks, sleeps, calendar dates | Time |
| Option/Result methods | unwrap, unwrap_or, expect |
Built-ins |
Exhaustive tables: stdlib.md.
Signatures source of truth: crates/zz_stdlib/src/funcs.rs.
Namespace rule
Section titled “Namespace rule”Globals are convenience aliases. Canonical homes:
std.vec.*for array pipelines (vec.*short form works afterimport std.vec).str.*forord/chr. Bareord/chrare aliases.int/floatreturnOption— reason discarded, fall back at the call site:int(s) ?? 0.typeofreturns a name string ("int","bytes") — compare with string equality only.
Prefer canonical homes in new code.
Error handling pattern
Section titled “Error handling pattern”import std.fs
match fs.read("data.txt") { .ok(c) => println(c), .err(e) => println("read failed: {e}"),}
// Propagate with ? inside Result/Option functions:func load(p: str) -> Result<str, str> { c := fs.read(p)? return .ok(c)}Bare Result as a statement warns. Handle it (match), propagate (?),
or ignore explicitly (_ := ...).