# Vex Standard Library

The standard library supplies reusable building blocks for Vex applications.
Most algorithms are written in Vex; platform services and selected providers
use native boundaries. Each module documents its imports, ownership, error
behavior and supported surface. Consult the module's layout and integration
requirements when connecting packages.

New to the library? Follow [your first standard-library workflow](../guide/stdlib-start.md)
to parse an input, transform it and add a test. For coding assistants, use
[the documentation exports and Vex skill](../guide/ai-tools.md).

Formatting is deliberately not a separate `std/fmt` package. Use
[`$format`, `$print`, and `$println`](../guide/advanced/builtins.md#i-o-formatting-and-debugging),
the built-in `Display`/`Debug` contracts, or
[`strings.StringBuilder`](strings.md) for reusable caller-owned construction.
This keeps format parsing, diagnostics, and allocation policy in one canonical
stack.

## Core Modules

| Module | Purpose |
| --- | --- |
| [CLI](cli.md) | Commands, arguments and flags |
| [Collections](collections.md) | Deques, stacks, priority heaps and indexed lists |
| [Compression](compress/index.md) | Bounded LZ4, Zstandard, Gzip, Zlib and Brotli codecs |
| [Context](context.md) | Cooperative cancellation, deadlines and metadata |
| [Contracts](contracts.md) | Conversion, collection and packed-data protocols |
| [Crypto](crypto/index.md) | Hashing, authenticated encryption, signatures and key derivation |
| [Database](db/index.md) | Owning synchronous SQLite access and optional native providers |
| [Encoding](encoding.md) | Checked text/binary encoding and reusable output |
| [Errors](errors.md) | Typed errors, causal chains and aggregation |
| [Filter](filter.md) | Predicate filtering and mask-based compaction |
| [File system](fs/index.md) | Files, paths, metadata, mappings and directory traversal |
| [Geographic coordinates](geo.md) | Geographic distances, bearings, routes, bounds and polygon operations |
| [Hash](hash.md) | Non-cryptographic hashing and explicit hash builders |
| [HTTP](http/index.md) | Client, parser and Fiber server APIs with explicit protocol boundaries |
| [I/O](io.md) | Readers, writers, buffering and stream adapters |
| [Logging](log.md) | Structured fields, loggers and sinks |
| [Networking](net.md) | TCP/UDP sockets and typed address/resolver APIs |
| [Randomness](rand.md) | Explicit reproducible streams and unbiased distributions |
| [Regex](regex/index.md) | Pattern compilation, matching and borrowed match ranges |
| [Semver](semver.md) | Semantic versions and version requirements |
| [Serde](serde/index.md) | Structured codecs and owning dynamic trees for six formats |
| [Sort](sort.md) | Ordering with explicit comparator and stability choices |
| [String conversion](strconv.md) | Checked parsing and numeric formatting |
| [Strings](strings.md) | Reusable string construction and string utilities |
| [System](sys.md) | Processes, environment and platform services |
| [Testing](testing.md) | Assertions, test context and benchmark context |
| [Time](time/index.md) | Monotonic elapsed time, wall time, durations and calendars |
| [TLS](tls.md) | TLS primitives and the documented transport/verification surface |
| [Unicode](unicode.md) | Character properties, casing, normalization and segmentation |
| [URL](url.md) | URI parsing/resolution and strict percent/form codecs |

## Builtin numeric namespaces

[Math](math.md), [Bit](bit.md), and [Crypto](../guide/crypto.md) are compiler
namespaces rather than packages. They require no import. The `Crypto` namespace
contains low-level primitives; the `crypto` package supplies complete algorithms.

## Images, media, compute and language tools

| Family | Guide |
| --- | --- |
| Image processing | [Vips](vips.md): owning pixels, transforms, filters, rows and codec providers |
| Video and audio | [Media](media.md): frame layouts, PCM/WAV, containers and codec components |
| Real-time protocols | [WebRTC](webrtc.md): SDP, ICE, RTP/RTCP, media queues and protection boundaries |
| Numeric kernels | [ML](ml.md): normalization, activations, linear algebra and attention |
| Model execution | [Inference](inference.md): model loading, generation and backend selection |
| Developer tooling | [Language tools](../guide/tooling/language-tools.md): the `ide/*` package family |

These guides distinguish complete entry points from lower-level components,
document required native providers, and show how to connect ownership and
buffer layouts across package boundaries.

## Choosing an API

Prefer owning values when data must outlive its input, borrowed views while
an owner remains live, and reusable-output APIs for repeated work. A pointer,
`Span`, or `RawBuf` parameter carries additional lifetime and capacity
obligations; it is not an automatic zero-allocation or safety guarantee.

Use checked parse/decode entry points for external data and set resource limits
where the API provides them. Preserve typed errors until the application boundary
so callers can distinguish malformed input, exhaustion, cancellation and I/O
failure. The [standard-library guide](../guide/stdlib.md) explains the prelude/package
boundary and routes common tasks to these references.
