docs / std

Standard library (std/)

Ordinary fx modules. Import them like any other library. They are not the C runtime and not the compiler. Linking still uses zspec when you allocate through the usual paths. Full inventory: Surface · package docs/STD.md / docs/SURFACE.md §D.

import std/vec;
import std/map;
import std/string;

Core collections & helpers (0.9.74)

ModuleRole
vecGrowable vectors · set / no-grow slot writes
stringCompare / concat / builder helpers
mapMap<string,i32> + *_ss for Map<string,string>
setSet facade over map (presence = 1)
bufGrowable Buf + Bytes view
box / pairGeneric ownership / pair helpers
mathabs min max clamp …
fmtInteger / tag formatting helpers
ioLines + file I/O (effects { io })
queueBounded queue (needs lib/ring_queue)
poolTyped Id id-pool (needs lib/id_pool)
fx_defaultsArena size / defaults helpers

Capability / guest / net

ModuleRole
capFsCap / OutCap / AllocCap / FuelCap / NetCap
guestbegin/end/mint/alloc/burn/net · pair with host/cap
io_capCap-scoped file I/O
netTCP dial under NetCap · dial_tls always fails in this package

HTTPS GET is a separate product CLI (fxfetch) that links Mbed TLS — not language-package TLS. See fxfetch.

Structured concurrency

Link host/concur. Facades: nursery · chan · select · mailbox · supervise · sync. Prefer spawn_i32 / await_i32 (no lexer keywords nursery/spawn/await). std/async is a deprecated stub.

Path, files, encoding, data, time

path · strutil · encoding · fs · fs_walk · log · json · json_validate · json_full · sqlite · http (llhttp parse-only) · time · env

Some modules need extra host units (host/std_*, cJSON, SQLite amalgamation).

Testing

testing (asserts) · proptest (property helpers) — used by fx test / fx fuzz.

Value-threading

Growing operations return an updated handle. Always reassign:

v = vec.push(v, 40);           // or vec_push(v, 40)
m = map.insert(m, "w", 30);    // or map_insert(...)
b = string.append(b, "hi");    // builder path

No-grow Vec slot writes: v = vec.set(v, i, x) or v[i] = x under effects { mut } (same semantics; does not grow capacity).

Vec

Map and set

Caveats

Surface · Language · Regions · Reference