Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

zil

An expression calculator and scripting language with units, dates, exact fractions and big ints.

Example results generated on 2026-10-08. Ones using now, today or randomness will differ when you run them: press Run on any example to run it in your browser, after editing it if you like.

a taste

# 4th Thursday of November
date(2026, 11, 1).nth_weekday(4, "thu")
# → 2026-11-26
# cities are time zones
date("2026-12-25 18:30") to "Sao Paulo"
# → 2026-12-25 21:30:00 -03:00
# units combine and convert
100 km / 2 h to mph
# → 31.0686 mph
# cups to grams
1 cup * density("flour") to g
# → 125.392 g
# money
$25/h to USD/workyr
# → $52,000.00/workyr
# error bars
5 ± 0.1 m * 2
# → 5 ± 0.2 m
# exact decimals
0.1 + 0.2 == 0.3
# → true
# factoring big ints
factors(2 ** 32 + 1)
# → [641, 6700417]
# calculus
integrate(sin, 0, pi)
# → 2
# geography
great_circle("Paris", "Tokyo")
# → 9712.52 km
# fuzzy matching
"recieve".closest(["deceive", "receive", "recipe"])
# → "receive"
# subnets
in_cidr("10.0.3.7", "10.0.0.0/22")
# → true
# odds in plain words
odds(2 ** -64)
# → "1 in 1.84 × 10^19: about as likely as a perfect March Madness bracket (1 in 9.20 × 10^18)"
# charts
(0..20).map(|x| sin(x / 3)).sparkline
# → "▅▆▇▇███▇▆▅▄▃▂▁▁▁▂▂▄▅"
# syntax: x.f(y) is f(x, y)   |x| x * 2 is a lambda   xs |> sum pipes   # comments

Modules

moduleabout
corevalues, printing, type conversions, parsing, help
fsfiles, directories, paths, JSON and CSV
sysscript arguments, environment variables, shell commands, HTTP GET
textcase, splitting, search, regex; encodings, ciphers and more below
text.layoutpad, center, wrap, truncate, dedent; snake_case, camelCase, slugs; words
text.compareedit distance, similarity, the closest of a list, line-by-line diffs
text.translationtranslate text between languages online; cached translations work offline
text.encodingbase64, base32, base58, URL and hex encodings, UTF-8 bytes, hex dumps
text.hashSHA-1/256/512, MD5, HMAC and CRC-32 of strings
text.ciphersCaesar, ROT13, Atbash, Vigenère, Morse, Braille, NATO spelling
text.fancymock case, l33t, uwu, Pig Latin, zalgo, upside-down, 𝐛𝐨𝐥𝐝/𝒮𝒸𝓇𝒾𝓅𝓉/wide
text.placeholderlorem ipsum placeholder text, random team and person names
datasorting and searching any collection; lists, maps, tables, charts below
data.listsranges, map/filter/reduce, building lists
data.mapskeys, values, lookups, merging and transforming maps
data.setsunique values in insertion order: union, intersection, difference
data.tablesrows under named columns: filter, pick columns, sort
data.chartssparklines, bar charts, histograms, plots, heatmaps, progress bars and trees
mathrounding, roots, logs, interpolation, constants; exact fractions and big ints
math.statssums, averages, spread and extremes of lists; units welcome
math.trigsine, cosine and friends; angles as units
math.numtheorygcd, primes, factoring, factorials, modular powers; exact at any size
math.bitscount, test, set, rotate and swap bits
math.baseshex, binary, octal and any base 2-36; digits of a number
math.formattingprintf and format specs, commas, numbers in words, ordinals, Roman numerals
math.randomrandom numbers and picks, dice, odds in plain words, fortunes, a magic 8-ball
math.uncertaintymeasurements with an error, 5 ± 0.1 m, carried through arithmetic
math.complexcomplex numbers, 2 + 3i; a number touching i is imaginary
math.linalgdot and cross products, matrix multiply, determinant, inverse, linear systems
math.calculusnumeric roots, derivatives and integrals of functions
unitsnumbers with units, combined and converted; live currency rates
units.constantsphysical constants (CODATA 2018); Planck’s constant is h_planck
units.moneycurrencies, live exchange rates, paid time like workday and workyr
units.goofybananas for scale, smoots, fortnights; every item also works as item_for_scale
units.kitchencups to grams with ingredient densities
financepay, interest and growth, loans, splitting bills, margins
timedates, durations, date math, relative text
time.calendarsperiods, weekdays, business days, week numbers, month grids, cron, zodiacs
time.zonesthe same moment in UTC, local time, any IANA zone or a city; world clocks
time.skysunrise, sunset, day length and moon phase for a place and date
geocountries and cities: lookups, distance, bearing, nearest city
devJWTs, URLs, semver, file permissions; networks, IDs, colors and codes below
dev.netIP addresses, CIDR blocks, subnets, well-known ports
dev.idsUUIDs, ULIDs and nano IDs; secure passwords and passphrases
dev.colorscolors as “#rrggbb”: RGB/HSL, mixing, lightening, WCAG contrast
dev.codescheck digits for cards, ISBNs and IBANs; HTTP status and MIME type lookups
artclip art, gradients, QR codes, images, animation; frames, fractals, games below
art.framesboxes, cowsay; art side by side, stacked, overlaid, mirrored, rotated, scaled
art.generativeL-systems, fractals, the Mandelbrot set, cellular automata, mazes, starfields
art.gameschess boards from FEN, playing cards, dice faces
art.figletbig-letter banners in FIGlet fonts like slant and shadow, or any .flf file