Standard library tour
What lives in core/, std/, and ext/, grouped by category.
The standard library is plain .nu source. You pull it in with $-imports.
No separate package step is necessary. It spans six layers (239 modules total):
| Layer | Path | Contents |
|---|---|---|
core | stdlib/core/ | Built into every program's assumptions: strings, vectors, Option/Result, slices, memory helpers |
std | stdlib/std/ | The general-purpose standard library: collections, I/O, time, threads, TLS 1.3, QUIC, post-quantum and classical crypto |
ext | stdlib/ext/ | Higher-level modules: HTTP/1.1, HTTP/2, HTTP/3, JSON, Protobuf, Zstandard, SQLite, PostgreSQL, package management, MCP |
net | stdlib/net/ | Sans-I/O protocol engines (TCP, UDP, DNS, DHCP, ARP, IPv4, Ethernet) and encrypted peer-to-peer transport |
dist | stdlib/dist/ | Distributed systems primitives: gossip, SWIM membership, Raft, CRDTs |
hal | stdlib/hal/ | Hardware abstraction layer: volatile MMIO and bare-metal microcontroller drivers |
Every module is plain-text and readable. The fastest way to see a module's
exact function signatures: use nurl_read_stdlib (via the
NURL MCP server) or open the file
under stdlib/ directly.
Core
| Module | Contents |
|---|---|
string.nu | the managed String type and its operations |
vec.nu | Vec[T], a growable array |
option.nu / result.nu | combinators for ?T and !T E — see Error handling |
slice.nu | first-class tracked slice views (slice_from_vec, slice_window, slice_of_str) |
mem.nu | low-level allocation helpers |
box.nu / cell.nu / pair.nu | small owned-value wrappers |
char.nu | character classification |
io.nu | basic input/output |
errors.nu | shared error-value shapes |
symtab.nu / posix.nu | compiler/runtime-facing helpers |
Collections
hashmap.nu, btree.nu, ordmap.nu (insertion-ordered map), set.nu,
deque.nu, heap.nu, bitset.nu, lru.nu — plus arena.nu for
bump-allocated batches, and arc.nu / rc.nu for shared ownership
(Arc is thread-safe, Rc is single-threaded — see
Concurrency).
Numbers, SIMD, and encoding
int.nu, float.nu, floatbits.nu, bigint.nu, decimal.nu, fft.nu,
and simd.nu (v128 / v256 vector operations) for numeric work; encode.nu,
utf8.nu, and unicat.nu (Unicode general categories and case folding) for text
encoding; fmt.nu for formatted output.
I/O and the operating system
fs.nu (filesystem), pfile.nu (PFile: positional reads and writes shared
by threads), mmap.nu (file_map read-only memory-mapped file views),
bufio.nu (buffered I/O), path.nu, process.nu, args.nu, env.nu (ext/),
signal.nu, term.nu, progress.nu, fswatch.nu.
Time and concurrency
time.nu, thread.nu (incl. Locked [T]), atomic.nu (Atomic),
rwlock.nu (RwLocked [T]), channel.nu, async.nu, async_ffi.nu — see
Concurrency for the full picture.
Networking
net.nu, dns.nu, udp.nu, unixsock.nu, url.nu, tls.nu,
tls_server.nu, tls_verify.nu, and the pure-NURL QUIC stack (quic.nu,
quic_pkt.nu, quic_crypto.nu, quic_conn.nu, quic_loss.nu, quic_tls.nu)
in std/; the HTTP/1.1, HTTP/2, and HTTP/3 stack (http.nu, http_server.nu,
http_router.nu, http_middleware.nu, http2_*.nu, http3_client.nu,
http3_server.nu, http3_frame.nu, http3_qpack.nu, and more),
websocket.nu, mqtt.nu in ext/. See
Networking for a guided tour.
Cryptography
Post-quantum primitives mlkem.nu (FIPS 203 ML-KEM-512/768/1024),
mldsa.nu (FIPS 204 ML-DSA-44/65/87), and slhdsa.nu (FIPS 205 SLH-DSA-SHAKE);
classical primitives aes_gcm.nu, chacha20poly1305.nu, ecdsa_p256.nu,
ed25519.nu, x25519.nu, rsa.nu; the hash_*.nu family (hash_sha256.nu,
hash_sha512.nu, hash_sha3.nu for FIPS 202 SHA3/SHAKE, hash_blake2b.nu,
hash_blake3.nu, hash_sha1.nu, hash_md5.nu); hkdf.nu, pbkdf2.nu,
scrypt.nu, minisign.nu, subtle.nu (constant-time comparisons),
x509.nu / x509_gen.nu, csr.nu (PKCS#10), pkey.nu (encrypted PKCS#8 v2),
and ssh.nu / ssh_ed25519.nu in std/; crypto.nu, jwt.nu, http_jwt.nu
in ext/. See Cryptography.
aes_gcm.nu runs on the language's hardware crypto tier where the CPU has
AES-NI and PCLMULQDQ, or AES and PMULL on AArch64 (nurl_v128_aesenc,
nurl_v128_clmul_*; ~3 GB/s on a Haswell, on par with the same kernel in C
intrinsics), on its VAES tiers where the CPU has
VAES and VPCLMULQDQ (nurl_v256_* on ymm, nurl_v512_* on zmm under
AVX-512: two and four blocks per instruction, ~8–11 GB/s on a Sapphire
Rapids) and on a constant-time bitsliced cipher everywhere else; TLS picks
AES-128-GCM on such a CPU and ChaCha20-Poly1305 otherwise.
Data formats and serialization
json.nu, msgpack.nu, cbor.nu, protobuf.nu, toml.nu, yaml.nu, xml.nu,
csv.nu, serde.nu (a Serialize trait), zip.nu, tar.nu,
compress.nu, deflate.nu, and zstd.nu (pure-NURL RFC 8878 Zstandard compressor and decompressor).
protobuf.nu provides checked Protocol Buffers wire readers and writers for
all scalar types, borrowed byte/submessage views, UTF-8 strings, packed fields
and groups. Message schemas remain in application code. See the
protobuf guide
for the API, ownership contract, limits and examples.
Packages and the registry
manifest.nu, resolver.nu, semver.nu, lockfile.nu,
registry_index.nu, pkg_fetch.nu, pkg_publish.nu, update_check.nu —
the pieces nurlpkg is built from. See
Editor and tooling.
Diagnostics and dev tools
bench.nu, log.nu, trace.nu, panic.nu (see
Error handling), sort.nu, cmp.nu, random.nu,
rng.nu, lifeguard.nu (false-positive suppression for failure
detectors), dos.nu (abuse-resistance limits), nurldoc.nu.
Distributed computing and embedded
stdlib/net/ and stdlib/dist/ build a peer-to-peer stack — encrypted
transport, NAT traversal, membership/failure detection, and CRDTs — on
top of the socket layer above. See Distributed computing.
stdlib/hal/ holds hardware-facing code (now an ESP32
memory-mapped I/O layer) for embedded targets — see
Embedded targets. Both are advanced, opt-in layers.
Next
- Networking
- Cryptography
- Distributed computing and Embedded targets
- Runnable examples for many of these modules are in
examples/— see Next steps.
Last updated on