Standard library¶
Dream includes a library for everyday tasks. Import the packages you need, such as import system.collections;. A few common types, including Option, Result, and Math, are available without an import. Shaders, rendering, and machine learning are in GPU and ML.
Each guide explains a task with examples. Entries with an API link also open the exact public declarations for that package in the API reference.
Core
Console, math, Option and Result, synchronization, and API errors.
Text and data
Strings, formatting, regular expressions, encodings, and SIMD.
Collections
Lists, maps, sets, queues, stacks, and queries over them.
- ListA growable sequence you read and change by position.
- MapLook up values by key.
- SortedMapA map that keeps its keys in order.
- SetKeep unique values and test membership.
- QueueProcess items in the order they arrive.
- StackRemove the most recently added item first.
- PriorityQueueRemove the smallest or highest-priority item first.
- Queries and SeqFilter, transform, and combine collection items.
System
Time, randomness, logging, testing, processes, and command-line arguments.
- RandomRepeatable random numbers for tests, games, and shuffling.
- DateTimeDates, times, time zones, durations, and stopwatches.
- LoggingRecord events with named loggers, levels, and handlers.
- TestingWrite
@testfunctions with assertions. - DebugInspect memory use while developing.
- ProcessLaunch and talk to child processes.
- CLI argumentsDefine commands and parse command-line arguments.
- Application utilitiesUUIDs, CSV, configuration files, and temporary resources.
- Raw sockets and compressionTCP and UDP sockets, plus gzip and deflate streams.
- Windows and game inputOpen a window or use a browser canvas, then read keyboard, mouse and gamepad input once per frame.
- Audio playback and FFTPlay audio, select outputs, and inspect PCM and frequency data.
Files and network
Files, streams, paths, URLs, and HTTP clients.
Serialization
Turn values into data formats and back.
Security
Secure randomness, hashing, and encryption.
Code generation
Libraries for writing source generators.