Skip to content

§6 Type System

Primitive types:

TypeDescriptionFFI C equivalent
int64-bit signed integer (default for unsuffixed integer literals)int64_t
float64-bit IEEE-754 float (default for decimal literals)double
numberDeprecated alias for float (kept for migration)double
stringUTF-8 string
booleanBoolean_Bool
voidNo return valuevoid
nullAbsence of a value

Integer and float types (for FFI and low-level use): i8, i16, i32, i64, u8, u16, u32, u64, usize, f32, f64

Bare unsuffixed integer literals default to int (i64); decimal or exponent literals default to float (f64). The number keyword is a deprecated alias for float retained for source compatibility. The compiler source and runtime prelude completed their migration to the explicit int / float spellings in Slice E.3a (May 2026); the alias itself is scheduled for removal in Slice E.4 after the strict-refusal reapply (E.3b) ships — tracked on the roadmap.

Composite types: structs, enums, arrays (T[])

Optional types: T? — the value is T or null

Union types: A | B — the value is either type; matched with match

Generic types: user-declared generics (fn first<T>(items: T[]) -> T?). Result<T, E> is on the roadmap; use union return types (T | MyError) today.

Wrapper types (syntax accepted; enforcement planned for 1.0+):

TypeSemantics
Affine<T>May be dropped, cannot be duplicated
Linear<T>Must be consumed exactly once
PII<T>Personally identifiable information — egress guards planned
Secret<T>Secret value — logging/serialization guards planned

Reference types (syntax accepted; borrow checking planned):

  • &T — shared (read-only) borrow
  • &mut T — exclusive mutable borrow

Raw pointer types (FFI, unsafe only):

  • *T — read-only raw pointer
  • *mut T — mutable raw pointer
  • *opaque — opaque foreign pointer (void*)