Guide 2 of 36
Getting Started
Install the toolchain, create a project, develop in watch mode, and choose a build destination.
On this page
Zolo keeps one source approachable, then lets the project choose where it runs. The same code can execute on the embedded VM, integrate with Lua 5.1 hosts, become a native binary through LLVM or Cranelift, or ship as WebAssembly.
This guide takes you from an empty directory to a real project and the everyday development loop.
Zolo is pre-1.0. The language is usable today, but APIs can still evolve. Keep the CLI and documentation from the same release together.
Choose your starting point¶
- Explore without installing: open the Playground and run an example in the browser.
- Build locally: install the complete toolchain, then create a project with the CLI.
- Learn from complete programs: browse Zolo by Example.
Install the toolchain¶
The recommended path is the prebuilt bundle for your operating system. It includes the zolo CLI, language server, debugger, and runtime:
Verify the installation:
zolo version
zolo doctorBuilding from source is still available for compiler contributors:
cargo build --releaseThe binary will be at target/release/zolo (target/release/zolo.exe on Windows).
Run your first Zolo program¶
Create hello.zolo:
const base = 2
/// Multiplies two integers and returns the result.
fn multiply(a: int, b: int) -> int {
return a * b
}
let result = base |> multiply(2)
print("Hello from Zolo!")
print("2 * 2 = {result}")Run it directly — a .zolo file is shorthand for zolo run:
zolo hello.zoloExpected output:
Hello from Zolo!
2 * 2 = 4Now ask the toolchain to check and format the same source:
zolo check hello.zolo
zolo fmt hello.zoloCreate a project¶
Use a template when you want a new directory:
zolo new hello first-zolo
cd first-zolo
zolo .Use zolo init my-project inside an existing directory. Both paths create a zolo.toml, which records the project entry point and compiler, formatter, test, and build settings.
zolo run, zolo build, and zolo . can discover the project entry automatically from zolo.toml, src/main.zolo, or main.zolo.
The everyday loop¶
| Goal | Command |
|---|---|
| Run and restart on changes | zolo run --watch |
| Type-check while editing | zolo check --watch |
| Run tests on changes | zolo test main.zolo --watch |
| Format a file | zolo fmt main.zolo |
| Find and fix lint issues | zolo lint . --fix |
| Start the interactive shell | zolo repl |
| Run with state-preserving hot reload | zolo dev main.zolo |
Add a test next to the function it exercises:
@test
fn multiply_works() {
assert_eq(multiply(3, 4), 12)
}Then run it:
zolo test hello.zoloChoose a destination¶
The source stays the same; the command selects the output:
| Destination | Command |
|---|---|
| Embedded VM | zolo run hello.zolo |
| Lua 5.1 source | zolo compile hello.zolo |
| Single Lua bundle | zolo bundle hello.zolo -o hello.lua |
| Native binary with LLVM | zolo build hello.zolo |
| Native binary with Cranelift | zolo build hello.zolo --emit native |
| WebAssembly for the browser | zolo build hello.zolo --emit wasm --host browser |
Run zolo help for the complete command surface, including coverage, benchmarks, profiling, packages, docs, templates, code generation, and shell completions.
Project shape¶
A small project starts with two files and grows only when needed:
first-zolo/
├── zolo.toml # project and toolchain configuration
├── main.zolo # entry point
├── src/ # optional modules
├── tests/ # optional integration tests
└── build.zolo # optional programmable build configurationWhere to go next¶
- Learn the core language: Variables and Types, Functions, and Pattern Matching.
- Set up the editor, formatter, and debugger: Tooling.
- Build a service: HTTP Server.
- Build for the web with Verniz: Web Development.
DOCS / FEEDBACK
Did this page leave a question?
Tell us where the explanation lost you. Documentation is part of the language experience.