Standard Library

Standard Library Reference

Current Raz standard modules and the native bridges used by each module.

Raz Gen2 Manual·Standard Library

Standard-library code complements the compiler. A Raz module owns its public Raz API; native headers provide implementation bridges where required and are not themselves Raz modules. Raz has no implicit prelude: dependencies are imported explicitly using use.

Module Public purpose Implementation
std.core Explicit access to core C++ representations such as string and vector. library/raz/std/core/core.raz
std.containers Generic collection helpers, including listLength, push, and append. Raz module plus containers_native.hpp
std.env getEnv, hasEnv, osName, architecture, and target metadata constants. Raz wrappers plus env_native.hpp
std.text length, slice, and int_to_string. Raz wrappers plus text_native.hpp
std.io print, file read/write, argument count, and argument lookup. Raz wrappers plus io_native.hpp
std.process Synchronous process execution, exit code, and success helpers. Raz wrappers plus process_native.hpp
std.json JSON document/node model, parser, and query functions. Raz implementation; uses std.containers and std.text

Import a module

use std.io;

print("Raz standard library");

Header ownership

Optional standard-library headers and user native headers should be requested through explicit imports where practical, including when the compiler itself needs those modules. The backend should not silently inject a growing set of optional libraries into every output. Any headers that are unavoidable for the minimum generated program must be identified as compiler scaffolding, not presented as user-imported modules.

Library rules to define

  • Public naming conventions and module versioning.
  • Error behavior for invalid I/O, process, text, and JSON operations.
  • Portability guarantees for native implementations.
  • Which functions are pure Raz, compiler built-ins, or native-bridge wrappers.
  • Whether generic collection helpers remain native or move into Raz when generic function support expands.