The prelude gives you a few names without a dependency clause. It keeps common output convenient without making every Core package global.
What you get without a dependency clause
The io namespace comes available in normal source files. It exposes Core IO helpers such as io.line(...).
io.line("Hello from the prelude")
The compiler-owned Error type also stays available for Error! flows.
What still needs a dependency clause
Most Core packages require explicit dependency clauses:
@core/math sin
@core/time mark_now
For the full prelude contract, collision rules and builder ownership, see Prelude policy advanced.
The prelude forms visibility policy, not an @core/prelude package. It defines the small set of names available without an explicit dependency clause. No @core/prelude package exists to bind.
Registered prelude surface
The prelude registers one namespace alias:
Bare name | Alias target | Exposes |
io | @core/io | Core IO console and input helpers |
The bare io namespace behaves as a compile-time alias to @core/io. It does not act as a runtime value. An explicit @core/io clause binds the same io namespace. An explicit @core/io as output clause creates a separate file-local namespace name. A different alias name does not shadow the prelude alias. Only a same-name collision follows the ordinary no-shadowing model.
Compiler-owned bare symbols
The compiler-owned Error type stays available as a bare language symbol for Error! flows. It works as a compiler-owned builtin, not a prelude symbol. The prelude registry does not register it. See Errors, options and assertions for the Error contract.
Collision policy
Prelude names participate in the ordinary no-shadowing collision model. Same-file declarations, source dependencies, binding-backed dependencies, aliases, prelude symbols and builtins cannot silently shadow one another. The prelude registers io as a reserved name first, then inserts it only if not shadowed.
What the prelude does not include
io is the only Core package in the prelude. It's there for convenience rather than semantic importance: it gathers the common host interactions ordinary programs need immediately. Every other Core package requires an explicit dependency clause, and changing that is a language-wide decision rather than a package-level one:
@core/math sin
@core/time mark_now
@core/text length
@core/random random_int
The prelude does not expose @core/collections directly. Collection methods work as compiler-owned receiver methods that lower to @core/collections host functions. See Core collections for that relationship.
Builder ownership
The compiler defines the prelude's meaning and reserved names. Builders use the canonical registration, so io remains reserved even when a custom environment implements none of its operations. Namespace visibility does not supply an executable host capability. Calls still require the selected target's documented implementation or unsupported outcome.
Official environments provide the Core catalogue under its capability contracts. Custom builders may implement any subset for local code without claiming official Core certification. Merely having the unused prelude does not make a managed package Core-dependent. The Lappet reference explains the separate package-admission policy.
Unsupported source forms
@core/prelude lacks validity. No @core/prelude package exists.- The prelude does not expose a namespace record that can be passed as a runtime value.
- The prelude does not expose
@core/math, @core/text, @core/random, @core/time or @core/collections without explicit dependency clauses.
Related concepts