Standard Library
Zena includes an expanding standard library. The goal is for the standard library to be fairly extensive, so that there are standard ways of performing common tasks without requiring third-party dependencies, and to give the Zena ecosystem common patterns, utilities, and data types to build upon.
WARNING
The standard library is in active development and is currently being reorganized. Library structure, naming, and APIs are experimental and subject to change.
See these GitHub issues for major upcoming changes:
Libraries
| Library | Description |
|---|---|
zena:args
|
Command-line argument parsing with flags, options, positional arguments, subcommands, and help text generation. |
zena:assert
|
Test and runtime assertions for validating values and error conditions. |
zena:async
|
Asynchronous programming primitives: futures, completers, structured concurrency with task groups, cancellation scopes, and microtask scheduling. |
zena:bench
|
Statistical benchmark runner for comparing execution performance across code variants. |
zena:cli
|
Command-line program environment utilities: arguments, environment variables, current working directory, and process exit. |
zena:collections
|
Collection data structures: maps, sets, and array types. |
zena:console
|
Standard output and error logging utilities. |
zena:core
|
Foundational language types and utilities: strings, errors, options, results, boxes, ranges, arrays, iterators, and byte buffers. |
zena:fs
|
File system operations: reading, writing, querying metadata, and directory traversal. |
zena:glob
|
Pattern matching and regular expression translation for glob patterns. |
zena:json
|
JSON serialization, deserialization, and AST representation. |
zena:math
|
Mathematical operations, numeric limits, bit manipulation intrinsics, and wide arithmetic. |
zena:memory
|
Low-level access to WebAssembly linear memory and memory allocators. |
zena:path
|
File path manipulation and inspection for forward-slash delimited paths. |
zena:process
|
Spawning and managing host processes from Zena programs. |
zena:regex
|
Regular expression parsing, matching, and text replacement. |
zena:simd
|
WebAssembly 128-bit fixed-width SIMD vector types and instructions. |
zena:stream
|
Asynchronous data streaming between producers and consumers. |
zena:task
|
Composable combinators for deferred asynchronous operations. |
zena:test
|
Test framework for structuring and running test suites. |
zena:time
|
Monotonic time measurement, durations, and timers. |
zena:url
|
URL parsing, resolution, percent-encoding, and URL pattern matching. |
zena:wasi
|
Low-level WebAssembly Component Model and WASI runtime integration. |
zena:wasm
|
zena:wasm — running other Wasm modules and waiting for their results. |