Find the alpha.16 standard-library module for your task, then open its reference for signatures, parameters, results, errors and limits. Install the matching compiler, VM and library together. Host I/O examples require the native toolchain.
Choose an import, keep the function names
import stdlib/time as time
An ordinary function calls time.now() directly. An async function instead uses:
import stdlib/time/async as time
and calls await time.now(). Both return Result[Instant,ClockError]. Pure helpers such as time.seconds(5) remain ordinary pure calls, even through the async import. An async import does not make every exported function async.
The module path selects the effect. Async functions may call pure code and await async operations; importing an ordinary blocking function does not make calling that function safe inside an async handler. A clock read is impure because its result depends on when the call occurs.
Module map
Paths below follow stdlib/. An /async counterpart exports the same value and error identities where both interfaces exist. Each module page includes signatures, parameters, return values, behaviour and errors. Ordinary and async forms are documented together.
| Need | Ordinary module | Async module | Main operations |
|---|---|---|---|
| Monotonic clock and timers | time | time/async | now, sleep; pure duration factories |
| Shared cells | state | state/async | create, read, update |
| Environment | environment | environment/async | get |
| Checked console I/O | console | console/async | read, write, write_line, write_error, write_error_line |
| Subprocesses | process | process/async | run(Command), arguments, exit |
| Files and directories | filesystem | filesystem/async | metadata, bounded reads, writes, directory operations |
| Confined filesystem access | filesystem/confined | filesystem/confined/async | read, read_link, root_identity |
| Staged directory publication | filesystem/staging | filesystem/staging/async | create, path, create_directory, write_chunk, create_symlink, publish, discard |
| SHA-256 | digest/sha256 | digest/sha256/async | create, update, finish, close; pure hash |
| Gzip decoding | compression/gzip | compression/gzip/async | create_decoder, decode_chunk, close |
| Raw HTTP transport | network/http_stream | network/http_stream/async | open, read, close |
| TCP clients and services | No canonical blocking counterpart | network/tcp/async | exchange, serve_bounded, serve_stream, serve, read_chunk |
| Nested bytecode execution | runtime/bytecode | No async counterpart | Ordinary runtime support; not a handler API |
Pure operations need no async twin: path construction, byte slicing, checked UTF-8 decoding, numeric operations and persistent collections can be called from either kind of function.
The testing modules provide assertions; testing/filesystem, testing/process and testing/reporting have /async counterparts for effectful test support.
Streams and owned resources
Use the module reference for each resource's ownership, limits, cancellation and cleanup contract. The async resource guide shows complete SHA-256 and gzip workflows. The input and publication guide combines console input, staging and confined reads.
For complete HTTP requests, start with the HTTP Client reference. For incoming requests, use the HTTP Server reference and Server Playbook.
Handle domain errors
Read the error contract on the relevant module page. Where an error exposes a category, use it for control flow and its documented rendering method for a human explanation. Do not parse diagnostic prose or automatically retry every error. There is no universal error record or rendering method.
For example, filesystem errors, process errors and HTTP stream errors have different context and native-detail types. Pure value failures are documented with paths, durations and UTF-8 decoding.
See the migration guide when replacing compatibility imports.
Testing reference
Anonymous functions, closures and State
The callable and State guide combines these features in a standalone counter and equivalent async HTTP handlers.