Skip to content
MIT License v0.1.7-alpha Rust + Lua 5.1 VM

Rust Syntax.
Lua Lightness.

A modern language with pipe operator, pattern matching, null safety and lazy iterators — running on a Lua VM implemented in pure Rust.

.zologreet.zolo
Types scroll
01 // Scroll the code — the notes on the right follow along.
use std::Iter
03  
04 // A product in a tiny store. The tag field is optional: not everything is labeled.
struct Product {
06 name: str,
07 price: float,
tag: str?,
09 }
10  
11 // Decorators wrap a function. @memoize caches the result by argument.
@memoize
13 fn discount(tier: str) -> float {
match tier {
15 "gold" => 0.20,
16 "silver" => 0.10,
17 _ => 0.0,
18 }
19 }
20  
21 impl Product {
22 // Methods take self. Interpolation supports format specs.
fn label(self) -> str {
let badge = self.tag ?? "no tag"
"{self.name} ({badge}): $ {self.price:.2f}"
26 }
27 }
28  
29 fn main() {
30 let cart = [
31 Product { name: "Keyboard", price: 79.90, tag: "sale" },
32 Product { name: "Mouse", price: 29.50, tag: nil },
33 Product { name: "Monitor", price: 259.00, tag: "new" },
34 ]
35  
36 // Pipe the cart through lazy transforms, then fold into a total.
37 let subtotal = cart
|> Iter.map(|p| p.price)
|> Iter.fold(0.0, |acc, x| acc + x)
40  
41 // if is an expression — it returns the matched branch.
let tier = if subtotal > 200.0 { "gold" } else { "silver" }
43 let total = subtotal * (1.0 - discount(tier))
44  
for p in cart {
46 print(p.label())
47 }
print("Tier {tier}: you pay $ {total:.2f}")
49 }
stdout
Keyboard (sale): $ 79.90 Mouse (no tag): $ 29.50 Monitor (new): $ 259.00 Tier gold: you pay $ 294.72
compiled in 4.2ms

Getting started is simple

$ cargo build --release · zolo run hello.zolo

See all installation options →

Everything you need, nothing you don't

Designed to be expressive, safe, and fast — without sacrificing readability.

Pipe Operator |>

Chain transformations like a functional pipeline. No nested callbacks, no temp variables.

"hello"
    |> String.upper()
    |> String.trim()
    |> print()

Null Safety

Optional types T?, optional chaining ?. and null coalesce ?? eliminate NPEs by design.

let city = user?.address?.city ?? "Unknown"
let name: str? = nil
if let n = name {
    print("Hello, {n}!")
}

Pattern Matching

Exhaustive match with guards, destructuring of structs, enums, and arrays.

match score {
    s if s >= 90 => "A",
    s if s >= 80 => "B",
    s if s >= 70 => "C",
    _            => "F",
}

Lazy Iterators

Infinite iterators with lazy evaluation. map, filter, take, fold, zip and much more.

0..
    |> Iter.filter(|x| x % 2 == 0)
    |> Iter.map(|x| x * x)
    |> Iter.take(10)
    |> Iter.collect()

Decorators

@memoize, @test, @benchmark, @retry, @log — extra power with zero boilerplate.

@memoize
fn fibonacci(n: int) -> int {
    if n <= 1 { return n }
    fibonacci(n-1) + fibonacci(n-2)
}

HTTP Server

Spin up a REST API without installing anything extra. Routing, JSON, path params included.

let app = http.router()
    |> http.get("/users/:id", |req| {
        #{ id: req.params.id, name: "Zolo" }
    })
http.serve(3000, app)

Database

SQLite built-in, SQL transpilation for Postgres/MSSQL/Oracle. Query, execute and manage data with zero setup.

let db = Database.open("sqlite://:memory:").unwrap()
defer db.close()
db.execute("CREATE TABLE users ...").unwrap()
let rows = db.query("SELECT *").unwrap()

Tooling

LSP, DAP debugger, formatter and VS Code extension ready to use immediately.

# Install
cargo build --release

# Use
zolo run hello.zolo
zolo fmt hello.zolo
zolo check hello.zolo
zolo test hello.zolo

Rust VM

Lua 5.1 VM implemented in pure Rust. Generational GC, string interning, fast by default.

// Compiles to Lua 5.1 bytecode
// Runs on custom Rust VM
// 0-based indexing
let arr = [1, 2, 3]
print(arr[0]) // 1

See it in action

Real language examples. Click "Open in Playground" to modify and run.

hello.zolo
let name = "Zolo"
print("Hello, {name}!")
print("Version: {1 + 1}.0")
output
Hello, Zolo!
Version: 2.0
Architecture
01 / 07
input

Source .zolo

Scroll to assemble the Zolo machine. Six plates lock around one core — each is an architectural decision. This first plate is your program: raw UTF-8 text.

UTF-8 text · the program you wrote
123457

Why Zolo?

Fast by default

Runs on the Lua 5.1 VM implemented in pure Rust with generational GC, string interning and tail call optimizations. Zero unnecessary overhead.

Tooling first

LSP with autocomplete and hover, DAP debugger, formatter, VS Code extension and REPL — all out-of-the-box with no configuration.

Batteries included

Complete stdlib: String, Array, Map, Set, Iter, BigInt, Option, Result. Native HTTP server. No extra installs to get started.

Familiar for modern devs

Syntax inspired by Rust and Swift. Braces instead of do/end. Static typing with inference. 0-indexed. If you know Rust or TypeScript, you'll feel at home.

Tech Stack

Implementation language Rust (edition 2024)
VM runtime Lua 5.1 bytecode
Native compiler Cranelift codegen
GC Generational tri-color mark-sweep
LSP tower-lsp (Rust)
Formatter AST-based printer
Build LTO fat, opt-level 3

Available Tools

zolo run
zolo compile
zolo check
zolo test
zolo fmt
zolo repl
LSP server
DAP debugger

Ready to start?

Try it in the playground, follow the tutorial, or read the full documentation.

enespt-br