Skip to content

Introduction

zil started as a calculator and grew into a scripting language and a shell. You don’t need all of that on day one. Read the section closest to how you work now, and come back to the others when you’re curious.

Type the math the way you’d write it on paper, units and all. zil keeps track of them, so 100 km / 2 h comes out as a speed, and adding meters to seconds is an error instead of a wrong answer. Put to after anything to see it another way: other units, a fraction, a time zone.

Every answer is saved. _ is the last one and _1, _2 and so on are the numbered ones, so you can build on a result like you would with a calculator’s memory. When you want more, like rounding, averages or dates, there’s a function for it already loaded. help lists them, and putting ? after anything explains it.

1
# units come along
2
100 km / 2 h50 km/h
3
# to converts
4
100 km / 2 h to mph31.0686 mph
5
# into mixed units
6
1.8 m to ft in"5 ft 10.8661 in"
7
# percentages
8
80 + 15%92
9
# three of them, with tax
10
19.99 * 3 * (1 + 8.25%)64.9175
11
# how long a download takes
12
4.7 GB / 50 Mbps to min12.5333 min
13
# a column total
14
[12.50, 8.25, 31].sum51.75
15
# when a call lands in Tokyo
16
date("2026-12-25 18:30") to "Tokyo"2026-12-26 09:30:00 +09:00
Example outputCtrl+Enter to run

Most of what you know carries over. There are variables, functions, if, for and while, lists and maps, and string interpolation with {}. What’s different is mostly about typing less. Nothing needs importing, since the whole library is always loaded. Any function can be called as a method, so x.f(y) means f(x, y) and you can write a chain of steps in the order they happen. Calls with no arguments drop the parens, and |x| x * 2 is a lambda.

Numbers behave more like math than like floats. Decimals are exact, so 0.1 + 0.2 == 0.3 really is true, integers never overflow, and 1 / 3 stays a third instead of rounding. Units are part of the value too, so mixing up meters and feet is an error instead of a bug you find later.

1
# x.f(y) is f(x, y)
2
"a-b-c".split("-")["a", "b", "c"]
3
# no arguments, no parens
4
"hello".upper"HELLO"
5
# lambdas
6
[1, 2, 3].map(|x| x * 10)[10, 20, 30]
7
# |> pipes a value into a function
8
[3, 1, 2] |> sort[1, 2, 3]
9
# functions
10
double = fn(x) { x * 2 }; double(4)8
11
# interpolation
12
"2 + 2 = {2 + 2}""2 + 2 = 4"
13
# exact decimals
14
0.1 + 0.2 == 0.3true
15
# fractions stay exact
16
1 / 3 * 3 == 1true
17
# no overflow
18
2 ** 1001267650600228229401496703205376
Example outputCtrl+Enter to run

zil has a command mode, so a lot of everyday shell use works as is. A line that starts with a command like ls, cd or grep is a shell command, and ! runs any other program, like !git status. Pipes, globs and > redirection all work.

The difference is what comes back. zil’s own commands return values, not text, so ls gives you a table of files you can filter or sum without parsing anything. |> hands the result back to zil so you can keep going, and for anything with real logic you get a proper language instead of [[ ]] and $(( )).

A few habits don’t carry over. Single quotes, $VAR and brace expansion are errors, and help shell shows what to write instead. Below, each line is shown with the zil call it turns into, which desugar shows for any line.

# long listing, hidden files too
ls -la src
# → ls("src", long: true, all: true)
# run any program
!git status
# → exec(["git", "status"], tty: true)
# pipe into a program
ls | sort
# → exec(["sort"], stdin: ls(), tty: true)
# hand the result back to zil
ls src |> len
# → ls("src") |> len
# only the big files
ls src |> where(|f| f.size > 10 KB)
# → ls("src") |> where(|f| f.size > 10 KB)
# a zil value as an argument
rm {old}
# → rm(old)

help examples is a long page of one-liners grouped by module, and the quickest way to see what’s in here. help syntax covers the whole language on one screen. help advanced has longer recipes that mix several modules. And help on its own lists every module, so help time or help geo shows everything in one.

Example results generated on 2026-11-04. Ones using now, today or randomness will differ when you run them.