A small, fast, memory-safe general-purpose language where wallets, payments and metering are keywords — shipped as a single static binary with zero dependencies.
Linux x86_64 / ARM64. Downloads the binary and the package manager.
curl -fsSL https://raw.githubusercontent.com/larz-scripter/larzscript/main/install.sh | sh
Or build it — one C file, no dependencies:
cc -O2 -o larzscript native/larzscript.c
./larzscript program.lz
A real general-purpose language — and money is part of the grammar.
# general-purpose: functions, dicts, comprehensions, f-strings
fn wordcount(text) {
let counts = {}
for w in text.split(" ") { counts[w] = counts.get(w, 0) + 1 }
return counts
}
print(f"squares: {[x * x for x in range(6)]}")
# money-native: wallets, pay, require, gas-metering
wallet customer = $20.00
wallet platform, creator
price premium = $9.00
fn buy(buyer) {
require buyer.balance >= premium, "not enough funds"
pay premium from buyer to platform
pay premium * 0.8 from platform to creator # a revenue split
}
buy(customer)
print(f"creator earned {creator.balance}") # creator earned $7.20
numbers, strings, lists, dicts, functions & lambdas, modules, comprehensions, try/catch/throw, f-strings, slicing, default params, lazy ranges.
$3.50 is exact cents; pay … from … to …, require, paywall/subscribe, and gas-metered functions are built in.
A precise mark-sweep garbage collector reclaims everything — verified under AddressSanitizer. Long-running programs stay bounded.
a multi-line REPL, a canonical formatter (fmt), a syntax checker (--check), a doc generator (larzdoc), and a package manager (larzpkg).
larzpkg install <name>A registry of installable libraries; they compose, e.g. json.parse(http.get(url)).
| Package | What it does |
|---|---|
json | parse & stringify JSON |
http | HTTP client (get/post/status/download) |
csv | parse & write CSV |
base64 | encode/decode base64 |
table | aligned ASCII tables |
color | ANSI terminal colors |
args | command-line argument parsing |
log | leveled logging |
test | a tiny test framework |
time · string · random · fs · mathx | time/duration · string utils · seeded PRNG · filesystem · math |
Add yours by opening a PR against packages/registry.txt.
The complete spec: values, operators, control flow, money, the standard library.
Run Larzscript live, no install.
Prebuilt static binaries for Linux x86_64 / ARM64.
Syntax highlighting for VS Code and Vim.