Std
Built-in Types
Boolean
Type
Alias
Size
Integers
i(n)andu(n)are valid for any bit widthn. You can create integers of arbitrary size, e.g.i7,u3,i256.
Signed
Type
Size
Range
i81 byte-128 to 127i162 bytes-32K to 32Ki324 bytes-2B to 2Bi648 bytes-9.2E to 9.2Ei12816 bytes-170U to 170UUnsigned
Type
Size
Range
u81 byte0 to 255u162 bytes0 to 65Ku324 bytes0 to 4Bu648 bytes0 to 18Eu12816 bytes0 to 340UFloating Point
Type
Size
Precision
f324 bytesSingle precision (IEEE 754)f648 bytesDouble precision (IEEE 754)Primitive Constants
All numeric types expose MAX_VALUE and MIN_VALUE constants. Floating-point types also expose MIN_POSITIVE and EPSILON:
i32 max = i32.MAX_VALUE; // 0x7FFFFFFF
i32 min = i32.MIN_VALUE; // 0x80000000
u64 umax = u64.MAX_VALUE; // 0xFFFFFFFFFFFFFFFF
f64 eps = f64.EPSILON; // 2.2204460492503131e-16
f32 minPos = f32.MIN_POSITIVE; // 1.17549435e-38Type
MAX_VALUE
MIN_VALUE
i8127-128i1632767-32768i320x7FFFFFFF0x80000000i640x7FFFFFFFFFFFFFFF0x8000000000000000u82550u16655350u320xFFFFFFFF0u640xFFFFFFFFFFFFFFFF0Type
MAX_VALUE
MIN_VALUE
MIN_POSITIVE
EPSILON
f323.40282347e+38-3.40282347e+381.17549435e-381.19209290e-7f641.7976931348623157e+308-1.7976931348623157e+3082.2250738585072014e-3082.2204460492503131e-16Size Types
Type
Alias
Description
sizeu32Platform size typesize_longu6464-bit size typec_resulti32C interop result typeVoid
Type
Description
Strings
Type
Description
Arrays
Type
Description
Pointers
Type
Description
Reflection
TypeInfo
struct TypeInfo {
i32 id;
i32 size;
i8* name;
u8 kind;
}Runtime type metadata available via the typeof intrinsic. The kind field encodes the category: 0 = integer, 1 = float, 2 = pointer.
object
struct object : Hashable {
TypeInfo* type;
void* data;
}A type-erased value with runtime type information. Used internally by variadic functions to inspect argument types at runtime.
Enums
optional<T>
Variant
Description
Empty()No value presentValue(T)Contains a value of type Tenum optional<T> {
Empty(),
Value(T)
}result<T, E>
Variant
Description
Ok(T)Success, contains the result valueError(E)Failure, contains the error valueenum result<T, E> {
Ok(T),
Error(E)
}