Documentation / Core packages / Prelude policy

Prelude policy

The prelude registers the bare io namespace without a dependency clause. The compiler-owned Error type also remains available without a dependency clause, but it is a builtin rather than a prelude symbol. Most Core capabilities still require visible dependency bindings.

Choose the explanation level: Prelude surface

Prelude surface

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

Most Core packages require explicit dependency clauses:

@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 builder provides the prelude. The HTML builder registers the io namespace alias through the Core prelude registration. The prelude surface forms the minimal universal starting point. Builders must provide it, but the actual implementations live in specific Core packages such as @core/io.

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