Skip to content
On this page

Getting Started

New here? Read Introduction first if you want to understand why Zolo exists — the Lua-ecosystem gap, the 6 pillars, and where it fits. This page is about running code.

Zolo compiles to pure Lua 5.1 bytecode, so the same .zolo you write runs in any Lua host (Roblox, Neovim, Redis, OpenResty, GMod…), and also has native (Cranelift) and WASM targets when there's no host. Let's get a program running.

Installation

Build from source:

cargo build --release

The binary will be at target/release/zolo (or target/release/zolo.exe on Windows).

Hello World

Create a file hello.zolo:

fn main() {
    print("Hello, Zolo!")
}

main()

Run it:

zolo run hello.zolo

CLI Commands

Command Description
zolo run <file> Compile and execute a .zolo file
zolo <file> Shorthand for zolo run
zolo compile <file> Show generated Lua code
zolo check <file> Parse and type check without executing
zolo test [file...] Run @test functions
zolo fmt [--check] <file> Format source code
zolo repl Interactive REPL
zolo version Show version
zolo help Show help

Test Options

zolo test tests.zolo                # run all @test functions
zolo test tests.zolo --filter fib   # only tests matching "fib"
zolo test tests.zolo --list         # list test names without running

Project Structure

A typical Zolo project:

my-project/
  src/
    main.zolo       # entry point
    lib.zolo        # library module
    utils.zolo      # utilities
  examples/
    hello.zolo
  tests/
    test_math.zolo

Next

Follow in order:

Search Zolo

9 results

enespt-br