Skip to content

Standard Library Root

Accepted

Accepted for V1 std resolution; full standard-library growth is deferred to CEPs for standard collections, allocator implementations, text and formatting, result policy, and standard utility APIs.

std is the canonical root module for the standard library. It is a normal module with module.toml, a version string, and a manifest-defined main .ct file. Its provider is the compiler/toolchain installation, so consumers do not list it in [dependencies].

Standard-library APIs should be organized by explicit domain namespaces exported from the std main file:

std.math
std.sort
std.mem
std.testing
std.collections
std.hash
std.fmt
std.debug
std.io
std.text

The exact module list is not fixed, but the rule is fixed: broad library facilities live under an explicit namespace. They are not prelude names.

std is available for resolution in every ordinary module:

const std = module("std")
include("module://std/main.ct")

This does not automatically bind the name std in source. Code must bind it with const std = module("std"), import it with import module("std"), or use module://std/... explicitly. Availability for resolution is separate from namespace pollution.

std is reserved. Ordinary module manifests and dependency aliases must not use std unless the toolchain is compiling its own standard-library module under toolchain build mode. Alternate standard-library replacement is future toolchain/build configuration, not V1 dependency aliasing.

std source receives the ordinary compiler-provided prelude initial scope like any other normal module. That does not make std part of the prelude.