Documentation
dusk is a small systems language that compiles to native code. The documentation is split into four sections: guides teach the language by task, the language reference states the rules precisely, the standard library pages document each shipped module’s API, and tooling covers the compiler CLI, the dawn package tool, and the roadmap.
Guides
Section titled “Guides”Task-oriented walkthroughs, in roughly the order you will want them. New to dusk? Start with Getting started and the Language tour.
- Getting started: install the toolchain and run your first program.
- Language tour: a quick pass over the core features, with small verified programs at each stop.
- Paradigms: how paradigm directives gate procedural, functional, and OOP features per file.
- Memory:
alloc,free,defer, allocators, arenas, ownership, and the generational heap. - Errors as values:
(T, error)returns and the must-handle rule. - Concurrency: threads, channels, mutexes, atomics, and the thread pool.
- Packages with dawn: importing code and fetching external packages from git.
- Examples tour: a guided walk through the repository’s runnable programs.
Language reference
Section titled “Language reference”The normative description of the language. Where a guide and a reference page cover the same ground, the reference is the one that states the exact rules.
- Overview and philosophy: design pillars, compilation model, and current status.
- Source files and modules: file structure, import resolution,
export, and file privacy. - Paradigm system: what each paradigm directive unlocks and how gating works.
- Type system: primitives, inference, strings, fixed arrays and slices, and the two pointer layers.
- Enums and match: sum types with payload-carrying variants and exhaustive
match. - Memory management: allocation, the
Allocatorinterface, ownership, and generational safety. - Functions: declaration syntax, pass-by-value semantics, and lambda capture.
- Interfaces and structs:
implblocks, vtable dispatch, and the no-inheritance rule. - Functional concepts:
map,filter,reduce,fold,foreach, monad blocks, and do notation. - Error handling: the
errortype, fallible functions, and must-handle enforcement. - Threads and the memory model:
spawn,join, channels, mutexes, the pool, and the memory model. - Builtins: every compiler-provided function and which paradigms gate it.
Standard library
Section titled “Standard library”API pages for the modules shipped under lib/std, all written in dusk itself.
- Overview: what ships, how imports work, and what is planned next.
- std.io: console printing, typed line input, and the file and stdin builtins.
- std.string: string helpers, number parsing, and the
StringBuildermutable string. - std.vector and std.map: the growable array and the string-keyed hash map.
- std.memory: the allocator module and the arena allocator.
- std.functional: the
MaybeandEithermonadic types. - std.concurrent: atomics, sleep, channels, mutexes, condition variables, and the thread pool.
Tooling
Section titled “Tooling”The programs around the language.
- The dusk CLI: the compiler’s eight commands and its build artifacts.
- The dawn package tool: fetching git-hosted packages into the local cache.
- Status and roadmap: where the implementation stands at 0.3.3 and what comes next.