Skip to content
Systems programming for what’s next.
— Vex

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 to parse an input, transform it and add a test. For coding assistants, use the documentation exports and Vex skill.

Formatting is deliberately not a separate std/fmt package. Use $format, $print, and $println, the built-in Display/Debug contracts, or strings.StringBuilder for reusable caller-owned construction. This keeps format parsing, diagnostics, and allocation policy in one canonical stack.

Core Modules ​

ModulePurpose
CLICommands, arguments and flags
CollectionsDeques, stacks, priority heaps and indexed lists
CompressionBounded LZ4, Zstandard, Gzip, Zlib and Brotli codecs
ContextCooperative cancellation, deadlines and metadata
ContractsConversion, collection and packed-data protocols
CryptoHashing, authenticated encryption, signatures and key derivation
DatabaseOwning synchronous SQLite access and optional native providers
EncodingChecked text/binary encoding and reusable output
ErrorsTyped errors, causal chains and aggregation
FilterPredicate filtering and mask-based compaction
File systemFiles, paths, metadata, mappings and directory traversal
Geographic coordinatesGeographic distances, bearings, routes, bounds and polygon operations
HashNon-cryptographic hashing and explicit hash builders
HTTPClient, parser and Fiber server APIs with explicit protocol boundaries
I/OReaders, writers, buffering and stream adapters
LoggingStructured fields, loggers and sinks
NetworkingTCP/UDP sockets and typed address/resolver APIs
RandomnessExplicit reproducible streams and unbiased distributions
RegexPattern compilation, matching and borrowed match ranges
SemverSemantic versions and version requirements
SerdeStructured codecs and owning dynamic trees for six formats
SortOrdering with explicit comparator and stability choices
String conversionChecked parsing and numeric formatting
StringsReusable string construction and string utilities
SystemProcesses, environment and platform services
TestingAssertions, test context and benchmark context
TimeMonotonic elapsed time, wall time, durations and calendars
TLSTLS primitives and the documented transport/verification surface
UnicodeCharacter properties, casing, normalization and segmentation
URLURI parsing/resolution and strict percent/form codecs

Builtin numeric namespaces ​

Math, Bit, and Crypto 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 ​

FamilyGuide
Image processingVips: owning pixels, transforms, filters, rows and codec providers
Video and audioMedia: frame layouts, PCM/WAV, containers and codec components
Real-time protocolsWebRTC: SDP, ICE, RTP/RTCP, media queues and protection boundaries
Numeric kernelsML: normalization, activations, linear algebra and attention
Model executionInference: model loading, generation and backend selection
Developer toolingLanguage tools: 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 explains the prelude/package boundary and routes common tasks to these references.

Released under the MIT License.