Under heavy development. This site describes the intended 1.0 language. Current features and performance vary. Development status
Sn50SnThe SnAPI programming language
Development · Evolving reference

Primitive types

Exact names for machine values.

Sn is under heavy development. This reference includes the intended 1.0 design; features may be incomplete in the current compiler. Read the status →

Numeric types

  • Signed integers: i8, i16, i32, i64, i128.
  • Unsigned integers: u8, u16, u32, u64, u128.
  • Floating point: f16, f32, f64.
  • Pointer-sized integers: isize, usize.

Other built-in types

  • bool represents true or false.
  • byte is an object-representation byte, storage-compatible with u8.
  • char represents a Unicode scalar.
  • str is a non-owning immutable UTF-8 view.
  • void represents an absence of a result.
  • never describes a computation that does not return normally.

Strings and ownership

str borrows text rather than owning its allocation. The standard library's String is an owning value with explicit allocator behavior.

Native types

C interoperability uses exact-width Sn types after target ABI validation, rather than a parallel family of c_int and c_long primitive spellings. Supported operations and target lowering must be checked against the selected toolchain.

Example: choose the width where it matters

let Health: i32 = 100;
let EntityId: u64 = 42;
let Position: f32 = 1.5;
let SimulationTime: f64 = 0.016;

These declarations make the storage and numeric intent visible. i32 and u64 are fixed-width integers; f32 and f64 are the corresponding floating-point choices. This is a declaration excerpt for use inside a function.

Documentation snapshot: October 24, 2026 About versions ↗
Searching Development · language & standard library