The compiler installs a prelude written largely in Atoll itself. Programs can use its scalar methods, collections, option/result combinators, tasks, streams, time values, and host APIs without redefining their signatures.
Prelude items are available without an import. They are not a separately linked package: semantic analysis installs their declarations before checking project source, and generic bodies specialize with application code.
| Area | Main surface |
|---|---|
| Scalars | bool, integer widths, float, f32, char, byte |
| Text and binary | string, substring, []byte, [..]byte |
| Collections | List, Slice, Map, SortedMap, Set, SortedSet, Range |
| Outcomes | Option, Result |
| Concurrency | Task, Stream, Selectable |
| Time | Duration, DateTime, Date, Time, TimeZone, ZonedDateTime |
| Host I/O | File, Dir, Http, WebSocket, Tcp |
| Data | QueryError, Frame, Df, Expr |
| Core contracts | Equatable, Hashable, Comparable, Display, Iterator, and others |
Chapter map
These pages document the public surface by concept:
- Numbers, Strings, and Bytes
- Lists, Maps, Sets, and Iteration
- Option and Result
- Time
- Files, HTTP, and TCP
- Traits, Unsafe, and Intrinsics
The prelude stubs under crates/atoll-sema/src/stubs/ are the canonical
signature inventory until generated API reference pages are added.
Support layers
A prelude declaration can be implemented in one of three ways:
| Layer | Meaning |
|---|---|
| Atoll body | Lowered and specialized like project source |
| Compiler builtin | Recognized and emitted directly by a backend |
| Host operation | Crosses the runtime boundary, often with Suspend |
This distinction matters when assessing maturity. A signature installed for semantic checking is not by itself proof that every backend has an implementation. The guide calls out provisional surfaces where the prelude still contains bodyless declarations without complete lowering.
Host operations also remain subject to deployment capabilities. A file or network call can type-check and still be denied by the host policy.
Failure policy
Standard-library APIs avoid hidden panics:
- optional access returns
Option[T]; - operational failures return
Result[T, E]; - checked numeric operations return
Option; - buffer and stream operations report capacity or closure explicitly.
Unchecked pointer and indexing operations are isolated behind unsafe and
document the proof expected from their caller.
Naming
Scalar types such as int, float, bool, char, and string remain
lowercase. Nominal types and traits use PascalCase. Methods follow
snake_case; older camelCase examples are not current Atoll spelling.
Legacy status
The older builtin directory contains names that are empty, renamed, or not
installed by the current compiler. In particular, there is no current prelude
type for Any, Email, Phone, Queue, Stack, Url, or Money, and the
old nominal bytes and Buffer types were replaced by []byte, [..]byte,
and the Bytes/Buffer traits. Define application-specific aliases or structs
instead of assuming those designs are builtins.
Likewise, common container names do not imply installed classes: use []T for
both stack- and queue-shaped application logic unless a project defines a
domain-specific abstraction.