Skip to content
Xen / docs

Search documentation

English · v0.1.0-demo.2

Type to search the documentation.

    한국어
    Xen / reference v0.1.0-demo.2

    Type rules

    Int = I64; Float = F64. Integers are I8, I16, I32, I64, U8, U16, U32, and U64. Floating types are F32 and F64. Bool is true or false; Unit has the value (). Strings contain bytes.

    Numeric types do not mix implicitly. Convert explicitly, for example with i32(value). Out-of-range conversions fail. Integer +, -, and * wrap. Division by zero and division of the minimum signed value by -1 are runtime errors.

    Use Vec<T>, structs, enums, and tuples. Declare methods in impl blocks. Generic functions and types are supported; supply all type arguments when inference is insufficient. Recursive data requires a Box or Vec boundary. Struct and enum == is unavailable.

    Learn more: Variables and values · Structs and enums · Generics and type inference

    Worked examples: Data types and conversions · Box and recursive data