Documentation · v0.1.0-alpha.1

Your first program

Create a small project, check the source, and run a native Hello, Zore! program.

1. Create the project

Create a directory named hello-zore, open it in your terminal, and create these two files. The source is also available as a downloadable main.ore.

zore.toml

name = "hello-zore"
zore-min = "0.1.0"
zore-max = "0.2.0"

Compiler bounds compare numeric versions, so this alpha compares as 0.1.0. These bounds do not promise stable compatibility. This guide uses exactly v0.1.0-alpha.1.

main.ore

package main

func main() {
    println("Hello, Zore!")
}

package main names the entry package. func main() is the entry function, and println prints the string followed by a newline. No imports or external dependencies are needed.

2. Check the program

Run these commands from the directory containing both files:

zore --version
zore check main.ore

The version should be zore 0.1.0-alpha.1. A successful check prints nothing and exits with status 0. It validates supported semantics without invoking clang or a native linker.

3. Run it

zore run main.ore

The compiler builds into a temporary directory and runs the program. Expected output:

Hello, Zore!

4. Keep a native executable

zore build main.ore

The executable is written to the current directory as main on Linux/macOS or main.exe on Windows. Run it directly:

Linux / macOS

./main

Windows PowerShell

.\main.exe

Both print Hello, Zore!. There is no --release build flag; native builds already optimize generated code. An executable targets the current host, and its runtime-library requirements still apply when you distribute it.

Keep going

Try editing the greeting, then check and run again. Use zore fmt main.ore to format your file. Learn how the same function syntax expresses borrowing in the ownership overview, or move on to formatting, tests, and packages.

Reviewed against Zore v0.1.0-alpha.1 · compiler source edcf5847b259f28ef0bbd1409a8c6751b39725cb. Upstream examples © Zore contributors, Apache 2.0.