Experimental · v0.5.0-preview.5

Ownership and memory

Understand explicit moves and current native allocation boundaries.

move_value consumes a lexical binding. Later reads are rejected until a mutable binding is reinitialized with the same type. The checker conservatively rejects some moves across loops and branches.

Native runtime regions bound tracked allocations and release their values on exit. This preview has no general reference or borrow syntax, lexical lifetimes or whole-process sandbox guarantee.

ownership-foundation

examples/ownership-foundation/src/main.zbl · v0.5.0-preview.5 · interpreter, bytecode, native

ZBL source
task consume(value: i64) gives i64:
    give move_value(value) + 1

fixed original = 40
next = move_value(original)
show consume(move_value(next)) + 1
next = 7
show next

task test_owned_scalar():
    value = 41
    moved = move_value(value)
    assert(consume(move_value(moved)) == 42)
Recorded output
42
7