Expression-oriented
Immutable values, matches, folds, and state loops make data flow explicit.
Core APIs such as Option, Result, operators, and iteration are ambient. Other standard-library modules are opt-in through std/...; project modules use source-rooted @/... or relative ./... and ../... imports.
import std/io
func main() = {
io.println("Hello world!")
}func factorial(n: int): int = match (n) {
..=1 -> 1,
_ -> n * factorial(n - 1),
}enum BinaryTree<T> {
Leaf(value: T),
Node(left: BinaryTree<T>, right: BinaryTree<T>),
}func odd_squares(nums: #[int]): #[int] = nums
.iter()
.filter((value: int) -> value % 2 == 1)
.map((value: int) -> value ** 2u)
.to_list()