Skip to content
maasdiPublic

About

Zore (pronounced zor): a natively compiled language with ownership-based memory safety and no garbage collector. Simple code, strong guarantees. Early development.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

468 Commits

Folders and files

Zore

CI License: Apache-2.0

Simple code. Strong guarantees.

Zore is a natively compiled programming language with ownership-based memory safety and no garbage collector. Parameters are borrowed by default, resources are cleaned up deterministically, errors are explicit values, and one ownership model covers synchronous code, async/await, lightweight tasks, and channels.

Zore is pronounced "zor". Its source-file extension, .ore, is pronounced "or". See the official naming rules.

package main

type User struct {
    Name string
}

func greet(user User) {
    println(user.Name)
}

func main() {
    let user = User{
        Name: "John",
    }

    greet(user)
}
$ zore run examples/semantic-target/main.ore
John

Note

Zore is in early development. The language specification is written; the bootstrap compiler implements a growing subset of it. Nothing is stable yet.

Project status

Area Status
Language specification MVP decisions locked in spec/language-spec.md
Lexer, parser, diagnostics Implemented, with error recovery
Name resolution and type checking Implemented for the supported synchronous and async subset: primitives, error, structs, collections, slices, functions and methods, closures, interfaces, generic functions and struct types, tasks, channels, mutexes, control flow, and Go-style untyped constants
Native code generation Implemented for that subset: LLVM IR with checked arithmetic and bounds, persistent async state machines, and a linked Rust runtime
Ownership, borrowing, and cleanup Implemented: Copy/Move classification, partial moves, shared and mut borrows, inferred regions for stored views, and cleanup on normal, error, and panic paths; task inputs use conservative borrow restrictions
Errors and ? Implemented for synchronous and async code, including propagation after awaiting async calls or task results
Local bindings Immutable let, mutable var, and explicit mixed target lists: (let value, var err) = load() and (let next, err) = load()
Strings Length, indexing, slicing, loops by character, +, and string(rune) work
Collections [T; N], Array<T>, map[K]V, and []T work; clone works for structs and collections; len, push, pop, and for … in loops work; conditional if [mut] name = map.entry(key) bindings borrow map entries
Closures and function types Implemented, including closures that are returned or stored, call-once closures, declared functions and methods as values, and go on closures and function-typed locals; async literals and async method values are awaited or spawned; a callee stored in a field, element, or map value cannot be spawned directly
Packages and imports Folders are packages; project and explicitly declared local and pinned Git dependency imports work, with exports, import checks, canonical identity, and cycle detection. Bundled packages: std/bufio, std/bytes, std/context, std/encoding/base64, std/encoding/binary, std/encoding/hex, std/encoding/json, std/errors, std/fmt, std/io, std/log, std/log/rolling, std/maps, std/math, std/net, std/net/http, std/net/url, std/os, std/os/exec, std/os/signal, std/path, std/path/filepath, std/slices, std/sort, std/strconv, std/strings, std/sync, std/time, std/unicode, and std/unicode/utf8. See local dependencies, Git dependencies and lockfiles, tagged dependencies, and release workflows.
Native library packages Curated, versioned adapter registration with package-owned C/Rust sources, ordinary Zore wrappers, recipe lockfiles and static linking; see native libraries
async/await, tasks, channels, mutexes Implemented for the supported operations: polled async tasks, channel send/receive and select, mutex acquisition, timers, TCP I/O, files, standard input, child processes, and cooperative cancellation. A waiting plain function occupies an OS worker; the runtime starts replacement workers
Self-hosting Long-term goal; a lexer and a parser written in Zore (compiler-zore/) match the Rust frontend in differential tests
Application testing zore test discovers _test.ore functions, checks whole packages, and runs each test in a fresh native process

Features outside the implemented subset are reported as errors, never silently accepted. Recursive owned structs through Array<T> and maps are supported, including cloning and deterministic cleanup; infinite-size by-value cycles are rejected. Package-level var is forbidden; package-level let values are supported. Async frames keep values needed across a suspension in the pinned heap frame; other locals use poll-local storage, and some same-type locals share a frame field, but frames are not shrunk by general liveness. Cooperative budgets yield long-running async loops, but scheduling has no forced preemption. The MVP evidence inventory records covered behavior and remaining conformance gaps; see the roadmap for tracked follow-ups.

Getting started

The alpha installation guide covers prebuilt compiler archives, checksums and the Linux builder image. Prebuilt archives remove the compiler source-build step; native application builds still require Rust and clang, which the builder image supplies.

To build the compiler from source, you need:

  • Rust, installed through rustup. The repository pins the toolchain in rust-toolchain.toml, so rustup selects it automatically. Native builds also invoke rustc (1.98 or newer) to compile and link the Rust runtime; set ZORE_RUSTC to choose its executable. The compiled runtime is kept in your cache folder (~/.cache/zore, ~/Library/Caches/zore on macOS, or ZORE_CACHE_DIR), so only the first build pays for compiling it.
  • clang with LLVM 15 or newer, for zore build and zore run only. macOS ships it with the Xcode Command Line Tools; on Linux, install your distribution's clang package. Set ZORE_CC to use a specific compiler.

Windows native builds target x86_64-pc-windows-msvc and also require Visual Studio C++ Build Tools and the Windows SDK. Use an x64 Developer PowerShell or Developer Command Prompt; set ZORE_CC to the full LLVM clang.exe path if needed. Generated executables have an .exe suffix. See platform support for host-specific APIs and CI evidence.

git clone https://github.com/maasdi/zore.git
cd zore
cargo build --release
./target/release/zore run examples/hello/main.ore

Usage

zore check main.ore   # check a file; prints nothing when it is valid
zore build main.ore   # compile to ./main
zore run main.ore     # build into a temporary directory and run
zore fmt .           # format .ore files recursively
zore fmt --check .   # check formatting without writing
zore test .          # run application tests recursively
zore --help

For project dependencies, run zore install to resolve and write zore.lock, zore lock to refresh it deliberately, and zore install --locked in CI to consume it unchanged. For a library release, use zore check --release, then the ordinary Git tag and push workflow; zore outdated reports newer releases without changing dependency selections. See the dependency guide, release metadata, and release workflow.

check, build, and run take a source file. The file's folder is the program's main package, so its ordinary .ore files are compiled together, and import finds other packages as folders of the project (see examples/packages). Diagnostics are printed to standard error with source locations, and the command exits with status 1. A program that panics reports the panic on standard error and exits with status 2; zore run passes the program's exit status through. Invalid command-line arguments also exit with status 2. zore fmt accepts a file or directory and needs no native toolchain; see the formatter guide. zore test accepts a file or directory; tests take no parameters and return nothing or error. See the application testing guide and multi-file example.

Repository layout

Path Contents
spec/ The language specification (authoritative)
compiler/ The single Rust compiler crate, organized by stage
runtime/ The Rust runtime linked into native programs
examples/ One tested, runnable program per supported feature
tests/ Integration tests and conformance cases
benchmarks/ Opt-in compiler, REST/JSON, frame and scheduler measurements
docs/ Architecture, roadmap, decision records, open questions

Documentation

Contributing

Contributions are welcome. Please read CONTRIBUTING.md and follow the Code of Conduct. Report security issues privately as described in SECURITY.md.

License

Zore is licensed under the Apache License, Version 2.0. Unless you state otherwise, any contribution you submit is licensed under the same terms, as described in section 5 of the license.

About

Zore (pronounced zor): a natively compiled language with ownership-based memory safety and no garbage collector. Simple code, strong guarantees. Early development.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages