docs / reference

Reference (0.7 surface)

Compact lookup for everyday fx in the 0.7.1 package. Prefer the language tour when learning. This page describes the language as implemented, not aspirational north-star ideas.

Keywords

enum struct extern fn import let match module return effects if while for break continue else defer region arena scope temp fx own mut true false using · plus ok / err constructors in Result paths.

Comments: // line comments. Refinement where is contextual (verification tier).

Literals

Program shape

Types

KindForms
Integersi8 i16 i32 i64 u8 u16 u32 u64
Floatsf32 f64
Scalarsbool string void core_Err
User typesstruct Name { … } · enum Name { A, B(T) }
CollectionsVec<T> · [T; N] · &[T] · StrBuilder · Map<string, i32>
SumResult<T, E>
Ownershipown T · &T · &mut T · &region r T
GenericsType params on functions/structs · no traits

Vec<T> elements commonly used: integers (incl. unsigned widths), bool, string, structs, payload enums. Casts: expr as T for numeric targets only.

Effects

fn f() -> i32 effects { alloc, mut, io } { … }
EffectMeaning
allocHeap / arena allocation
mutMutation of heap / exclusive borrows as required
ioHost I/O (stdout, files, …)

Regions

SyntaxRole
region r = arena(n);Default heap arena
region r = temp(n);Short-lived heap batch
region r = scope;Stack borrow region (no heap)
region r = fx(n);Hierarchical fx region

Details: Regions and effects

Operators

No v[i] on Vec; use vec_get / facade vec.get.

Statements

Result / ?

Builtins vs std facades

AreaBuiltins (common)std facade
Vecvec_new vec_push vec_get · .lenstd/vec (new/push/get/len)
Stringstr_compare str_concat str_len str_byte_atstd/string
Builderstrbuf_new strbuf_push strbuf_finish strbuf_lenbuilder/append/build
Mapmap_new map_insert map_get map_containsstd/map · set via std/set
Fmt / IO(via facades)std/fmt · std/io

Growing ops are value-threaded: reassign v = vec_push(v, x), m = map_insert(m, k, v), b = strbuf_push(b, s).

Scaffolds

KindUse when
simpleDefault: region + std/vec
minimalBare main; add region yourself
embeddedTiny arena; builtin vec_*; no staged std

Honesty bound (not in 0.7 yet)

Advanced: refinement types (where predicates) exist as a verification tier and typically need an external prover pipeline. Not required for everyday 0.7 programs.

Language · CLI · llms.txt