Stdlib Index
Every module that ships with AILANG, grouped by what it's for. Pure modules can be imported anywhere; capability modules need their capability passed via --caps at run time.
ailang run --caps IO,Net,Clock examples/runnable/myprogram.ail
See Effects for how the capability system works, Modules for import syntax, and Browse Packages for third-party modules published to the registry.
Data & Collections
| Module | Purpose | Capability |
|---|---|---|
std/list | Functional list operations: map, filter, fold, take, drop | — |
std/array | O(1) indexed arrays (vs lists, which are O(n) indexed) | — |
std/map | O(1) key-value lookup backed by Go hashmaps | — |
std/string | Length, substring, trim, split, replace, case | — |
std/bytes | UTF-8 encoding, base64, byte-level operations | — |
std/iter | FoldStep and bounded folds for early exit | — |
Algebraic Data Types
| Module | Purpose | Capability |
|---|---|---|
std/option | Some(x) / None for values that may not exist | — |
std/result | Ok(x) / Err(e) for operations that can fail | — |
Numerics & Randomness
| Module | Purpose | Capability |
|---|---|---|
std/math | Trigonometric, exponential, logarithmic, rounding | — |
std/rand | Random integers, floats, booleans (seeded) | Rand |
Time
| Module | Purpose | Capability |
|---|---|---|
std/datetime | Pure date/time math (parsing, formatting, arithmetic) | — |
std/clock | Wall-clock time and sleep; deterministic mode supported | Clock |
std/game | Frame timing for game loops: delta time, FPS | Clock |
Encoding & Serialization
| Module | Purpose | Capability |
|---|---|---|
std/json | JSON encode/decode | — |
std/xml | Parse XML strings into XmlNode trees, query elements | — |
std/gzip | Gzip compress/decompress (base64-encoded I/O) | — |
std/zip | Read/write ZIP archives (including .docx, .xlsx, .epub) | — |
std/tar | Read entries from uncompressed tar archives | — |
std/jwt | Parse and verify JSON Web Tokens | — |
std/crypto | Hash, HMAC, symmetric/asymmetric primitives | — |
I/O
| Module | Purpose | Capability |
|---|---|---|
std/io | Print to stdout, read from stdin, exit codes, raw bytes | IO |
std/fs | Read/write files; sandboxed via AILANG_FS_SANDBOX | FS |
std/env | Environment variable access (snapshot, allowlist, redaction) | Env |
std/process | Execute external commands; allowlist + timeout + size limits | Process |
Network
| Module | Purpose | Capability |
|---|---|---|
std/net | HTTP GET/POST; HTTPS by default, DNS rebinding prevention | Net |
std/stream | WebSocket (bidirectional), SSE (server-sent events) | Stream |
AI & Semantic
| Module | Purpose | Capability |
|---|---|---|
std/ai | General-purpose AI oracle: string -> string, JSON variants | AI |
std/embedding | Compute embedding vectors via host-provided model | varies by host |
std/sem | Semantic frame caching primitives | Clock, SharedMem |
std/sharedmem | Key-value shared memory (effect wrappers for caching) | SharedMem |
std/sharedindex | Namespace-partitioned similarity search index | SharedIndex |
std/simhash | SimHash fingerprints for near-duplicate detection | — |
Tracing & Debug
| Module | Purpose | Capability |
|---|---|---|
std/debug | Structured tracing and assertions; erased in --release mode | Debug (ghost) |
std/trace | Emit custom spans and events into the trace pipeline | Trace |
std/trace_test | Test helpers for trace-based assertions | Trace |
Importing modules
module myapp
import std/io (println)
import std/list (map, filter)
import std/result (Result, Ok, Err)
export func main() -> unit ! {IO} {
let xs = [1, 2, 3, 4, 5]
let evens = filter(\x. x % 2 == 0, xs)
println("evens: ${evens}")
}
Run with: ailang run --caps IO myapp.ail
See also
- Effects — how the capability system works
- Modules — import syntax,
module,export func - Browse Packages — third-party modules published to the registry
- Language Syntax — full reference