Skip to content
PT

Static copy

Copied from docs/guides/stdlib-reference.md in https://github.com/poppy-team/ori-lang (MIT). Pinned to revision 42e1817227fbc96e8e4a4a85fac78b3fec0a0e0f, blob 66961a01ae4be925c6138e5374195477db6390fa. The source repository remains canonical; this copy is refreshed through a sync pull request, not live.

Standard library reference map ​

Audience: users choosing an ori.* module Portuguese: stdlib-reference.pt-BR.mdNormative contracts: spec/12-stdlib.md

The standard library has three layers:

  1. Layer 1: Rust runtime primitives registered in the compiler manifest;
  2. Layer 2: safe .orl wrappers;
  3. Layer 3: algorithms written in Ori.

Use the canonical parent module first. Compatibility paths such as ori.string.utils and ori.map.algorithms remain available where documented, but new code should prefer ori.string, ori.map, and the other parents.

Module map ​

DomainCanonical modulesTypical use
I/Oori.io, ori.fs, ori.pathstreams, files, paths
Text and bytesori.string, ori.string_view, ori.bytes, ori.convertparsing, formatting, zero-copy views, encoding
Collections & memoryori.list, ori.map, ori.set, ori.queue, ori.stack, ori.deque, ori.heap, ori.linked_list, ori.doubly_linked_list, ori.buffer, ori.slotmap, ori.span, ori.memcontainers, contiguous buffers, generational slots, scoped bump arenas
Graphics & imagesori.imageBMP/PPM image generation, typed Image structs
Errors & diagnosticsori.err_trace, ori.fs.FsError, ori.net.http.HttpErrordomain error enums and zero-cost error traces
Data formatsori.json, ori.validateJSON and validation helpers
Time and randomnessori.time, ori.random, ori.formattime, sampling, display
Processes and environmentori.args, ori.config, ori.os, ori.processcommand-line tools and host state
Networkingori.net, ori.net.httpTCP, TLS, UDP, HTTP client, Response helpers
Concurrency & asyncori.task, ori.channel, ori.atomic, ori.concurrent, ori.cancelfutures, tasks, channels, atomics, thread transfers, cancellation scopes
Securityori.cryptopassword and TOTP helpers
Testingori.testassertions, skips, leak checks, doctests
Domain structuresori.graph, ori.treegraph and tree algorithms

Import styles:

ori
import ori.io as io
import ori.fs (read_text_or)

main()
    const text: string = read_text_or("notes.txt", "")
    io.println(text)
end

The complete signatures and backend status are in 12-stdlib.md. The generated website data comes from ori doc export; run ori doc check to validate inline docs and .oridoc sidecars.

Async filesystem, connect, and TLS helpers use a shared bounded native pool (up to four workers and 256 queued jobs), so blocking work does not create one thread per request.

Text positions and bytes ​

string stores valid UTF-8. len(text), text.len(), slicing, indexing, index_of, chars(), and direct for iteration use Unicode scalar positions. They do not expose UTF-8 byte offsets. One visible grapheme can still contain multiple scalars; use bytes and string.to_bytes when a protocol requires the encoded bytes. Grapheme segmentation and normalization are planned but are not current stdlib APIs.

Backend and error conventions ​

Native runtime functions are the semantic reference. Filesystem operations that can fail return result[...]; ori.io.read_line returns optional[string] at EOF or when the input is not valid UTF-8. Networking has both blocking wrappers and async helpers, but the async reactor is not a separate OS-level event loop yet.

Opaque collections expose methods through their module contracts rather than a public memory layout. Do not pass their internal representation through FFI.