Pelago documentation
Learn Pelago, a compiled systems language with value semantics, no garbage collector and no runtime.
Pelago is a compiled systems language. Programs become native executables, memory is managed without a garbage collector, and the language has no runtime to ship alongside your code. Values behave like values, errors are ordinary results, and integer overflow stops the program instead of wrapping silently.
fn main() {
print("Hello, Pelago")
}Getting started
Install the pelago tool, write a program, run it and build an executable.
Tour
Ten short programs that introduce the language.
Language guide
Values, functions, types, pattern matching, collections, errors, ownership, concurrency and modules.
Language reference
The precise rules: lexical structure, keywords, operators, types, declarations and semantics.
Standard library
The core types and the std modules: io, os, json, regex and big.
Tools
The pelago command, targets, configuration, formatter and language server.
Examples
Short complete programs that run.
Design and performance
What Pelago guarantees, what the checks cost and how speed is measured.
Editor setup
Highlighting and live diagnostics in VS Code, Zed and any editor with Tree-sitter.
Troubleshooting
Fixes for the problems people hit first.
What you can expect
- One tool.
pelagochecks, runs, builds, formats and serves editors. - Native output. Executables for Linux and Windows on x86-64 and AArch64, with no linker and no C library involved.
- Predictable behaviour. No exceptions, no null, and exhaustive
switch. Overflow, out-of-range indexes and similar faults stop the program with a message. - Small programs. A hello-world executable is a few kilobytes.
Every code sample on this site is compiled, and its output checked, before it is published.