Skip to content
Konjure / spatial intelligence

Numbers, text and bytes

Exact integer widths, portable floats and immutable data.

Choose a numeric type

FamilyTypesArithmetic
Unsigned integersu8, u16, u32, u64, u128Exact, with overflow checks
Signed integersi8, i16, i32, i64, i128Exact, with overflow checks
Binary floatsf16, f32, f64, f128Rounded at the declared precision; finite values only
Tick 0 · 0.00 s⌘ / Ctrl + EnterThis device
main.kj
Loading the language runtime…
Output 0
No output.

A literal takes its type from a field, argument, return type, binding annotation, or typed operand. Without numeric context, it defaults to f64; Number is a compatibility spelling of f64. Use value.convert[T]() for an explicit checked conversion. It returns Res[T, DataError]; overflow, fractional float-to-integer conversion, and lost precision are data errors.

Use data methods

Data operations belong to the value they read or transform. The fixture prints 3, Some(2), [2, 2], 10, 255, and café. Change the final byte and Run to see Bin.decode() return a matchable DataError instead of an exception.

Tick 0 · 0.00 sThis device
main.kj⌘ / Ctrl + Enter
Loading the language runtime…
Output 0
No output.
ReceiverMethods
Strlen(), utf8(), get(index) -> Opt[Str]
Binlen(), decode() -> Res[Str, DataError], get(index) -> Opt[u8]
List[T]len(), append(value), get(index) -> Opt[T]
Tensor[T]len(), shape(), reshape(...), transpose(...), sum(), matmul(...), get(indices), convert[U]()

Str is immutable UTF-8 text and Bin is immutable bytes. Str.utf8() makes the encoding boundary explicit; Bin.decode() checks it. get returns Some or None for an absent index. Global len, utf8, decode, append, shape, reshape, transpose, sum, matmul, and convert calls are not part of the language API. print, range, and tensor constructors remain top-level operations; tensor[T](values, shape) returns a checked Res[Tensor[T], DataError].

Checked operations return values the caller can match or propagate. A failed runtime operation never silently wraps or substitutes a value; a failed action or lifecycle transaction preserves the previously accepted state.