Primitive Types
Integer types
| Type | Size | Range |
|---|---|---|
i8 | 1 byte | -128 to 127 |
i16 | 2 bytes | -32,768 to 32,767 |
i32 | 4 bytes | -2B to 2B |
i64 | 8 bytes | Full 64-bit signed |
u8 | 1 byte | 0 to 255 |
u16 | 2 bytes | 0 to 65,535 |
u32 | 4 bytes | 0 to 4B |
u64 | 8 bytes | Full 64-bit unsigned |
Aliases: int = i64, uint = u64, byte = u8
Floating point
| Type | Size | Precision |
|---|---|---|
f32 | 4 bytes | ~7 decimal digits |
f64 | 8 bytes | ~15 decimal digits |
Alias: float = f64
Boolean
tape
let flag: bool = true;
let done: bool = false;String
tape
let greeting: string = "Hello, world!";Strings are owned UTF-8 sequences in t1/t2. In t0, use []const u8 instead.
Void
tape
fn do_something() -> void { }Zero-size type for functions that return nothing.
Color literals
tape
let red: color = #FF0000;
let semi_transparent: color = #FF000080;#RRGGBB and #RRGGBBAA syntax — produces a color value directly.
Numeric literals
tape
let decimal: i64 = 1_000_000;
let hex: u64 = 0xFF_AA_00;
let binary: u8 = 0b1010_0101;
let octal: i32 = 0o777;
let pi: f64 = 3.14159;Underscores are allowed in numeric literals for readability.
Last modified: