Getting Started

Zolo is a modern programming language built on top of the Lua 5.1 VM, with syntax inspired by Rust and Swift. It compiles to Lua and runs on a custom Lua VM implemented in Rust.

Philosophy #

  • Curly braces {} instead of do/then/end
  • Explicit types with inference (like Rust)
  • 0-based indexing
  • Optional semicolons
  • Native string interpolation
  • Null safety by default
  • Functional expressiveness with |> and short closures

Installation #

Build from source:

bash
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:

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

main()

Run it:

bash
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 #

bash
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 Steps #

enespt-br