RecurLoop/ Documentation
RecurLoop/Languagev0.2.12

Native types

Native types specify the representation used by compiled code. They complement the runtime value kinds introduced in Values.

Scalar, pointer and array types

Built-in native types include signed and unsigned integers (i8 through i64, u8 through u64), f32, f64, void, Context, and Phrase. Pointers use *, arrays use [N], and function types use fn (...) -> ....

Compile-time constants

Array lengths may be non-negative integer constants, including qualified names such as u8[Layout:BrickCount]. Compiled functions read const bindings in their lexical dictionary scope and embed their values in native code; local variables and parameters take precedence. Mutable interpreter bindings are not captured.

Function types

Function types are structural: parameter types, result, calling convention, and variadic state determine identity. A named signature phrase can be reused as both a definition template and a type.

recurloop
let Unary = fn (value:i64) -> i64

let increment = Unary {
    return value + 1
}

let apply = fn (callback:Unary, value:i64) -> i64 {
    return callback(value)
}