Language overview
Familiar function syntax, with ownership and borrowing expressed in the places that matter.
Bindings, types, and functions
let creates an immutable binding, var a mutable binding, and const a compile-time constant. Every local binding has an initializer. := is not Zore syntax.
Functions use func. Struct construction names every field. Files in a folder form one package; exported package declarations and fields start with an ASCII uppercase letter. Local names do not become exports through capitalization.
The supported subset includes primitive values, strings, structs, fixed arrays, borrowed slices, owned dynamic arrays and maps, functions and methods, closures, interfaces, and generic functions and struct types. Refer to the specification for each form’s restrictions.
Borrow by default
This complete example comes from the alpha README. Save it as main.ore in a separate directory, then run zore check main.ore and, with the native toolchain, zore run main.ore.
package main
type User struct {
Name string
}
func greet(user User) {
println(user.Name)
}
func main() {
let user = User{
Name: "John",
}
greet(user)
}
Download this complete program
The output is:
John
The parameter user User borrows by default. greet(user) needs no move marker, and the caller keeps its value. A parameter written user mut User requests an exclusive mutable borrow; user own User transfers ownership according to the value’s type.
Mutating a borrowed value requires permission in the function signature. The compiler rejects conflicting borrows, use after a move, and views that could outlive their backing storage. Lifetimes are inferred; there are no source lifetime annotations.
Copy, Move, and cleanup
Copy or Move behavior follows the type. Primitive values, strings, and channel handles are Copy. Owned dynamic arrays and maps are Move. A struct derives its classification from its fields: a Move field makes the struct Move.
Moving a value transfers responsibility for its cleanup. Independent duplication uses explicit clone when supported. Cloning a view does not extend the lifetime of its backing storage.
Resources are cleaned up deterministically on normal returns, error propagation, and panic paths under ordinary language execution. Explicit process termination is a separate boundary. There is no tracing garbage collector.
Errors are values
A function may return an explicit error, alone or as the last result. Callers handle the returned error or use ? to propagate it. Propagation returns from the current function and preserves ordinary resource cleanup; it does not introduce hidden ordinary exceptions.
The same error model applies to async calls and task results. The specification describes result shape, nil, and the grouping of await with propagation.
One ownership model for concurrent code
async func operations can suspend with await. go starts concurrent work and can return a task handle. A synchronous caller retrieves results with task.wait(); an async caller uses await task.
Dropping a task handle detaches it. It does not cancel the running work. Channels copy Copy messages and transfer Move messages. Mutable access still requires exclusivity, including across suspension.
The alpha supports scoped tasks, channels and select, mutexes, timers, and supported I/O operations. Ordinary unscoped tasks conservatively reject borrowed inputs when a safe lifetime cannot be proven. Scheduling is cooperative; long-running work has no forced-preemption guarantee.
Read the detailed rules
Continue with the pinned language specification, examples index, and conformance evidence inventory. Check the alpha boundaries before assuming another language’s syntax or library behavior applies.
Reviewed against Zore v0.1.0-alpha.1 · compiler source edcf5847b259f28ef0bbd1409a8c6751b39725cb. Upstream examples © Zore contributors, Apache 2.0.