Auk's words in plain language. Each entry is a couple of sentences and a link to the page that explains it properly. If a word in the docs stops you, look here first.
async and await#
An async fn is a function that can run as a task, alongside other work. await
waits for its result. Awaiting a list of tasks runs them all at the same time.
let (a, b) = await (get(u1), get(u2)) // both requests run at onceMore: Concurrency.
binding#
A name for a value. let x = 1 makes a binding that never changes; var n = 0 makes one you
can assign to again.
More: Basics.
channel#
A pipe for sending values from one task to another: one side calls c.send(x), the
other c.recv(). Tasks share no memory, so channels are how they talk.
More: Concurrency.
clause#
One case of a function. Instead of one body full of ifs, you can write a function several
times, each with a pattern for the arguments it handles. The compiler checks that
together the clauses cover every case.
fn fib(0): int = 0
fn fib(1): int = 1
fn fib(n: int): int = fib(n - 1) + fib(n - 2)More: Functions, clauses and patterns.
closure#
A small function written in place, usually to hand to another function: x => x * 2.
[1, 2, 3].map(x => x * 2) // [2, 4, 6]More: Functions.
contract#
A promise written on a function and checked while the program runs. requires says what must
be true when the function is called, ensures what must be true of its result.
More: Tests, contracts and holes.
core library#
The functions and modules every program has without installing anything: strings, lists,
maps, fs, net, time and so on.
More: Core library reference.
dependency#
A package your project uses. raft add json adds one, and after that
json.parse(text) works anywhere in the project.
More: Getting started.
dot call#
Calling a function by writing it after its first argument: x.f(a) means exactly f(x, a).
It works for any function, including your own, so chains read left to right.
More: Functions.
effect#
Something a function does to the world outside the program: reading a file (fs), using the
network (net), reading the clock (time). A function lists its effects after uses, so its
first line tells you what it can touch.
fn load(path: str): str! uses fs = fs.read(path)?More: Effects.
enum#
A type that is one of several named choices, each of which can carry its own data.
enum Shape { Circle(r: float), Rect(w: float, h: float) }More: Structs, enums and shapes.
error (T!)#
A return type ending in ! means "this value, or an error". fail("message") returns an
error, ? passes one up to the caller, and else handles one. Auk has no exceptions.
More: Errors and optionals.
error code#
Every compiler message has a code such as E0200. auk explain E0200 prints a page about it
with the mistake and the fix, and every code has a page here too.
More: Error codes.
hole#
?? stands in for code you haven't written yet. The program still type-checks and its tests
run; auk build won't ship it until the hole is filled.
More: Tests, contracts and holes.
manifest#
The raft.toml file at the top of a project. It names the project, lists its
dependencies, and lists the effects the whole program may use.
More: raft, the package manager.
module#
One .auk file. Anything in another module is reached by its path, such as
pricing.with_tax(x). There are no import lines.
More: Modules and packages.
optional (T?)#
A type ending in ? means "this value, or nothing". Auk has no null: if a value may be
missing, its type says so, and the compiler makes you handle that.
let name = find(users, 9)?.name else "nobody"More: Errors and optionals.
package#
A project that other projects can depend on, installed with raft.
More: Package docs, Modules and packages.
panic#
The program stopping because of a bug, such as an index past the end of a list. A panic is not an error: errors are expected and handled; panics mean the code is wrong.
More: Errors and optionals.
pattern#
A description of the form a value can take, used to take it apart: Circle(r), [first, ..rest],
(a, b), some(v). Patterns appear in match, in clauses and in let.
More: Functions, clauses and patterns.
pure#
A function with no effects. Its result depends only on its arguments, and the compiler guarantees it.
More: Effects.
raft#
Auk's package manager. raft new makes a project, raft add adds a dependency.
More: raft, the package manager.
shape#
A list of functions a type must have. Any type with those functions fits the shape, with nothing to declare on the type. Shapes are how you write a function that works for many types.
shape Area { fn area(self): float }More: Structs, enums and shapes.
struct#
A type that groups named fields.
struct Point { x: float, y: float }More: Structs, enums and shapes.
task#
A piece of work running alongside others. Calling an async fn starts
one. Tasks share no memory, so one crashing can't corrupt another.
More: Concurrency.
test#
A test "name" { ... } block next to the code it checks. auk test runs them, and they are
left out of built programs.
More: Tests, contracts and holes.
unit of measure#
A label on a number, such as 3.0<m> or float<m/s>. The compiler stops you adding metres
to seconds, and the labels cost nothing when the program runs.
More: Units of measure.
uses#
The word that introduces a function's effects: fn main() uses fs, net.
More: Effects.
Value#
A neutral tree of data (null, booleans, numbers, strings, lists, maps) that JSON, TOML, YAML and CSV all convert through. Your structs and enums convert to and from it automatically.
More: Core library reference.
var#
A binding that can change. On a parameter, var means the function changes the
caller's variable, and the caller marks the argument with &.
More: Functions.