This is Wave's standard library. This standard library operates independently of Wave's compiler and is not part of the compiler itself.
The Wave standard library in this directory is licensed under the
Apache License 2.0. It may be modified, redistributed, and embedded
in other products under the terms of that license.
The Wave compiler and other repository components outside std/ remain
licensed under the repository's Mozilla Public License 2.0.
- General-purpose
extern(c)bindings belong understd/libc/*. - Target providers under
std/sys/*may use the small set of hosted C ABI bindings explicitly approved bytools/check_std_policy.shwhen the OS does not expose an equivalent stable raw syscall contract. std/sys/wasm/*maps its raw imports to WASI Preview 1 capabilities. The provider covers descriptor I/O, clocks and sleep, preopened paths, environment access, process exit, and linear-memory allocation. The allocator is also available to barewasm32-unknown-unknownmodules. A separate Memory64 allocator backswasm64-unknown-unknownwithout narrowing pointers.- Modules outside
std/libc/*must not importstd::libc::*; portable modules depend on the target-independentstd::sys::*provider surface instead.
std::time: portable clocks and sleep, normalized durations, UTC calendar conversion, and fixed ISO 8601 parsing/formatting.std::env: cwd and environment lookup helpers.std::path: allocation-free path utilities.std::math: checked integer arithmetic, bit operations, IEEE-754 helpers, roots, and trigonometry.std::mem: raw allocation plus checked byte-size, copy, move, comparison, alignment, runtime target page sizing, and bounded C-string helpers for non-GC code.std::buffer: checked growable byte storage built onstd::mem.std::io: fd-level read/write/seek/copy helpers.std::fs: basic open/read/write/copy/metadata helpers.fs_read_allreads into caller-owned byte storage; it does not allocate or returnstr.std::bytes: endian primitives, borrowed byte views, checked random access, and transactional byte readers/writers.std::process: fork/exec/wait and stdio redirection helpers.std::debug: lightweight marked logging, value tracing, assertions, and fatal diagnostics for development builds.
- Public modules are split by role under
std/<name>/*.wave(for example,std/time/duration.waveandstd/bytes/cursor.wave). - Target-specific providers stay under
std/sys/<os>/<arch>/when the native ABI differs by architecture.