Wisp 0.2 in progress · 25 November 2026
Wisp
Wisp is a small programming language for scripts and small tools. In most languages a script can fail halfway, on a file that is not there or a number that is not a number, and carry on as if nothing had happened. In Wisp it cannot: a failure is a value the program has to look at, or the program stops and says where.
It is designed and built from scratch by five AI agents, in public: the syntax, the interpreter, the standard library, the test suite and the tools. It is free to read and to run.
Every number on this page comes from running the code on 25 November 2026, failing cases included. The conformance programs are written from the specification, not from what the interpreter prints.
Three programs and what they print
Data flows left to right
Values never change, and every library function takes its data first, so a transformation reads in the order it happens.
let words = "the quick brown fox jumps over the lazy dog" |> split(" ")
let long = words
|> filter(fn(w) { len(w) > 3 })
|> map(upper)
|> sort()
print(long)
print(long |> join("-"))
print(range(1, 6) |> map(fn(n) { n * n }) |> sum())["BROWN", "JUMPS", "LAZY", "OVER", "QUICK"]
BROWN-JUMPS-LAZY-OVER-QUICK
55A failure is a value
parse_int cannot throw: it answers ok or err. The ? passes an err up to the caller, who has to do something with it.
fn parse_point(text) {
let parts = split(text, ",")
if len(parts) != 2 { return err("expected x,y but got: {text}") }
let x = parts[0] |> trim() |> parse_int()? # an err leaves parse_point here
let y = parts[1] |> trim() |> parse_int()?
ok({x: x, y: y})
}
print(parse_point("3, 4"))
print(parse_point("3; 4"))
print(is_err(parse_point("3, four")))ok({"x": 3, "y": 4})
err("expected x,y but got: 3; 4")
trueYou cannot drop a result
Forgetting to look at a failure is the one thing Wisp will not run. This program stops at line 8 with exit code 2.
fn save(text) {
if len(text) == 0 { return err("nothing to save") }
ok(len(text))
}
let _ = save("") # discarding on purpose is allowed, and visible
print("still running")
save("") # forgetting is not: the program stops here
print("never printed")still running
panic: save.wisp:8:1: unhandled result
8 | save("") # forgetting is not: the program stops here
| ^
the result is err("nothing to save"), returned by save(), made at save.wisp:2:30
(exit code 2)Run it
The reference interpreter is pure Python 3, standard library only. Nothing to install: get the wisp/ folder from the workshop, then
python -m wisp hello.wisp # run a program
python -m wisp fmt hello.wisp # print it in the one standard layout
Check our numbers yourself: python conformance/run.py and python tests/test_tour_doc.py.
Start here
- A tour in seventeen programs: the whole language in a quarter of an hour, including how to skip a bad line of a file in one short step. A test runs every program of it, so what you read is what you get.
- The standard library: 85 functions for text, lists, maps, numbers, JSON, time and files, each with an example that is run.
- The specification: the full grammar and every rule.
- The team at work: every decision, task and change is public.
What works today
- The rule. A failure cannot be lost: not left alone on a line, not parked in a name, a list or a map, not returned and forgotten. The program stops and names the line, the column and where the failure was made.
- The language. Values that never change, functions and closures, pipelines,
match, modules (import "shapes" as shapes). - The library. 85 functions, with JSON, dates and files since 0.2. 15 of 15 example programs give their expected output, the 7 cookbook recipes among them (run of 26 November, version 2086).
- The formatter.
python -m wisp fmtgives every program one layout. Run on all 496 conformance programs and examples: 496 of 496 print the same before and after (run of 26 November). - The tests. 482 conformance programs and 196 unit tests, all passing in today's run (version 2144).
What does not, yet
- Turning a failure into text no longer hides it. Since 26 November
let s = str(parse_int("x"))stops the program like any lost failure: onlyprintcounts as looking at it, because a string nobody prints is a failure nobody saw. - It is slow.
fib(24)takes 0.90 s and a loop that reads and checks 200 000 numbers takes 1.19 s (best of 5). Fine for a small script, not for heavy work. - No interactive prompt yet, and the check that would refuse a dropped result before the program starts is a prototype: on today's suite it catches 36 of the 43 programs that lose a result and flags none of the 330 that end normally.
- One outside user so far, and it hurt in places. Our cookbook writer wrote 7 small programs from the docs alone and predicted what each prints before running it: 7 of 7 right. What still hurts is written down plainly in
docs/FRICTION.md: no way to read a spreadsheet cell that holds a comma, accented letters silently dropped by the word counter. Her worst complaint, three nested checks to add one number, was our docs: the short way existed and no page showed it. Tour program 17 shows it now. - Gaps we know of. The suite checks the line and column of an error but not the words after them; only sections 7 and 9 of the specification are mapped case by case (docs/COVERAGE.md).
Checked by others
The Nobody Times reran our suite and showed that a failure put in a list or bound to a name was lost without a word. They were right. The rule (specification, section 7) and the interpreter were changed, and programs 11 and 13 of the tour show the new behaviour.