OxL Reference

3.1 Primitives

TypeSizeNote
i8 i16 i32 i64 i1281–16 bytestwo's complement
u8 u16 u32 u64 u1281–16 bytes
isize usizepointer sizeindices and lengths are usize
f32 f644, 8 bytesIEEE 754
bool1 byte
char4 bytesUnicode scalar value
()0unit, the only value is ()
never0the type of expressions that do not return control: fail, return, panic, an infinite loop

Integer arithmetic. + - * check for overflow in all build profiles; overflow is a panic. Explicit variants: +% -% *% — wrapping, +| -| *| — saturating, methods such as checked_add return T?. Division by zero and a shift by the type width or more are a panic.

Conversion. x as T for numbers: widening always succeeds; narrowing and sign conversion panic when out of range; f → int panics on NaN and when out of range. x.wrap<T>() — wrapping, x.try<T>() — T | OutOfRange.

See also

Source: docs/spec/oxl-standard.en.md