Primitive Types

Integer types

TypeSizeRange
i81 byte-128 to 127
i162 bytes-32,768 to 32,767
i324 bytes-2B to 2B
i648 bytesFull 64-bit signed
u81 byte0 to 255
u162 bytes0 to 65,535
u324 bytes0 to 4B
u648 bytesFull 64-bit unsigned

Aliases: int = i64, uint = u64, byte = u8

Floating point

TypeSizePrecision
f324 bytes~7 decimal digits
f648 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: