Standard library overview
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 |
Built-ins |
std.str, std.vec, std.bytes |
strings, arrays, builders | Strings and arrays |
std.map, std.set, std.dec, std.csv, std.property |
data helpers | Data |
std.fs + bytes |
files, dirs, providers, buffers | Filesystem |
std.json |
parse/stringify/get/as_* | Data + Filesystem |
std.http |
server + client | HTTP |
std.net (+ tls/unix) |
TCP | Networking |
std.env, std.args, std.process, std.sys, std.log |
OS integration | Env and processes |
std.math, std.time |
numerics, clocks, dates | Math and time |
std.term, std.colors |
terminal + ANSI | Terminal |
std.encoding, std.crypto, std.uuid |
codecs, hashes, IDs | Encoding and crypto |
std.regexp |
compiled patterns | Regexp |
std.sqlz (+ postgres/mysql) |
SQLite + wire drivers | Databases |
std.chan, std.task, std.cell |
concurrency | Concurrency |
asserts, std.test |
tests, temp dirs, snapshots | Test helpers |
| 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)? .ok(c)}Bare Result as a statement warns. Handle it (match), propagate (?),
or ignore explicitly (_ := ...).