Standard Library

Overview of the stdlib, how to import modules, and how to generate API docs.

Standard Library

Sounio’s standard library lives in stdlib/ in the repository. It provides core data structures, I/O, math, and domain modules (epistemic computing, scientific computing, etc.).

Current project scale (v0.100.0):

Importing Modules

Sounio supports both use and import forms (the parser accepts either in many cases).

Examples seen in tests and examples:

use math::*
import stdlib.math.*

Practical tip: when in doubt, search the repo for the module you want and copy the import form used there.

What to Read First

  • stdlib/core/: Option<T>, Result<T, E>, basic traits
  • stdlib/io/: console + filesystem APIs
  • stdlib/math/: scalar math utilities
  • stdlib/collections/: Vec, maps/sets (where available)
  • stdlib/epistemic/: Knowledge<T> design + semantics

API Docs (Generated)

The repo includes a doc generator:

# Generate HTML docs for stdlib into a directory
cargo run --bin souniodoc -- generate stdlib --output website/public/api

Then serve the website and visit /api/.

Note: Generated files should usually be treated as build artifacts (do not commit unless you intentionally vendor them).

Next