Lowent Manual←↑→

Appendix E — Standard library modules

Part IX (chapters 32–37) toured the standard library by use. This appendix is a reference, one page per module, gathering what each does, which ops it offers and what it does not do. It is not a place to read from the start but a place to open when needed.

Module pages share one shape. The head gives the source file, layer and capabilities received, followed by what the module does, its ops at a glance, how to use it, design and boundaries, and what is not built. The maturity each module writes (experimental, incubating, standard) is authoritatively in the source head and the development repository’s ledger and moves between editions, so it is not copied here. The conventions every module follows — the caller’s buffer, failure as a value, all or nothing, ownership that must be settled — are in chapter 32.

Module names may differ from file names. What use looks for is the module declaration in the file (lib/str.low is strings, lib/alloc.low is allocs). Cross-module names are always called qualified (strings.find), and a frequently used one can get an alias with use codec as c ..

ModuleIn one line
stringsString view operations — cut, find, compare
strbufOwned string buffer and null-terminated cstr
fmtFormatting assembled into the caller’s buffer
utf8UTF-8 code point iteration and validation
utf16UTF-16 surrogate arithmetic
unicodeUnicode property tables — extracted mechanically
codecHex · base64
regexPike VM regular expressions without backtracking
termThe pure half of a terminal renderer — ANSI assembly · screen diff · width
sortlibIn-place quicksort for u64
sortgenGeneric sort — the type brings the comparison
searchlibBinary search over sorted slices
hashmapu64 → u64 open addressing
strmapByte string → u64 hash map
vecsGrowing byte vector
spscLock-free single-producer single-consumer ring buffer
hashHash-map slots (FNV-1a) · damage detection (CRC-32) · SHA-256
mathFloating-point maths — close instead of ==
randomSeparates reproducible sequences from OS entropy by name
hmacHMAC-SHA256 · HKDF — who sent it
chachaChaCha20 stream — not safe alone
polyPoly1305 — a fresh key per message
aeadChaCha20-Poly1305 seal and open — cryptography starts here
x25519Key agreement
aesAES-128 block cipher — usually wrong used alone
gcmAES-128-GCM — never repeat a nonce
bigintBig-number modular arithmetic
rsaRSASSA-PSS verification
p256NIST P-256 curve and ECDSA verification
p384NIST P-384 curve and ECDSA verification — the public web’s intermediates
ecdsaECDSA P-256 signing — nonce derived without randomness
ed25519Ed25519 signature verification
derMinimal DER parser — extracts public keys only
pemUnwrapping PEM envelopes
x509Reading X.509 certificates — offsets and lengths only
verifyCertificate signatures and one link of a chain
tls13TLS 1.3 parts — key schedule · records · transcript · Finished
tlssrvServer TLS handshake and application data records
tlscliClient TLS 1.3 handshake — the caller checks certificates
httpHTTP/1.1 request parser — its heart is rejection
soaA trial of laying structs out as per-field arrays

Table 50.1 — L0 — pure computation (effects none · the caller’s buffer)

ModuleIn one line
allocsAllocator trait · bump allocators · two default allocators
poolGenerational-handle block pool
shardTokens splitting storage into non-overlapping pieces
budgetBit budgets for handles and retiring generations
wireFields in one word — a mask carries position and width
flagsNamed on/off settings in one word
segarenaFixed-size segment arena
pagecachePage ids and pin tokens
growvecGrowing byte vector — short name for vecgen.vec u8
vecgenGeneric growing vector vec t
mapgenGeneric hash map table k v
nodelistFixed-size intrusive list
segviewCursor, total length and flattening for scattered views
lifemodelifemode · lifeatom — when a value ends

Table 50.2 — L1 — storage (needs the allocation capability or borrowed bytes)

ModuleIn one line
ioStream reading over slices
outbufBuffered output — forgetting to flush is rejected
filesFiles and directories — forgetting to close is rejected
ttyTerminal input — raw mode · reading keys · pure key parsing
netSockets — TCP loopback · in-process connection pairs
clockTime and deadlines — monotonic and wall clocks
trustFinding a trusted root in the trust store — the bundle is streamed

Table 50.3 — L2 — host (needs capabilities)

The cryptographic modules are stacked in layers towards TLS 1.3; that order and the top that does not exist yet are in chapter 36.