Skip to content
pannous edited this page Oct 16, 2026 · 9 revisions

The warp command

warp app.warp runs a program; warp eval '…' runs a line of code; warp help lists every command. warp '2+3' runs code too, even when it starts with a command's name as a variable: warp 'lower = "abc"; lower' gives "abc", not the lower command.

warp app.warp              # run it
warp build app.warp        # the executable app plus app.wasm next to it
warp dev page.warp         # serve a page, reloaded when it changes
warp serve app.warp        # serve its page and routes
warp app page.warp         # show its page in a window of its own (macOS web view)

warp build makes a standalone executable (no warp needed to run it) and writes the WebAssembly module beside it; --wasm makes only the module, --exe only the executable. A page program builds into an app that shows its page. A plain run writes no executable unless WARP_EXECUTABLE=1 is set.

Formatting

warp format app.warp writes the one canonical layout of warp code in place; give it files or folders. warp lint is the same command.

warp format samples            # rewrite every .warp file below samples/
warp format check app.warp     # only list what would change: app.warp:3: layout: <rule>, exit 1 if anything would
warp format hash-comments a.warp   # also turn // comments into # comments
warp beautify app.warp         # the layout plus the best-practice rewrites (so far: // comments become #)
warp format help               # the usage

The layout: tabs, name: value (a parameter's type too: area(width: int, height: int)), every binary operator spaced (x = a + b * 2), one space after a comma, list separators as written. Formatting never changes what a program means: whitespace can be meaning in warp (f it-1, 1 -1), so every change is checked by parsing before and after, and one that would change the program is left out. A file that does not parse is reported and kept.

Soft hints come with every run but never fail it: abbreviations (cnt → count) and // comments (// is also floor division, so # reads better); a hint that warp beautify resolves names that command with the file. Only warp files are changed: .warp and .wasp files and scripts whose first line is a #! line running warp. Folders named golf/ are skipped (code golf counts bytes).

The options are words, not --flags: see the style guide.

Warnings

--no-hints, --warnings=<level> and --strict[=<level>] choose which warnings show and which fail: warning.

Exit status

A whole-number result is the program's exit status: a file ending in 42 exits with 42, so a script can tell the shell how it went. Any other result, a float too, exits 0; a failed run exits 1.

Other programs

exec sh "ls -l" runs a command (without a shell) and gives what it printed; a failing command is an error with its exit status.

Sandbox

warp --sandbox program.warp runs a program you do not trust, as hosted programs run: it reaches the network (fetch), but writes files only inside the state folder (the working directory, .. and symbolic links refused) and starts no process, sound player, MIDI sender or C library. A refused word is the error "capability denied", naming the flag:

exec sh "echo hi"          // os.exec needs the process capability, which warp --sandbox does not grant
write("../x.txt", "a")     // writing ../x.txt through ..: … only inside the state folder

Proofs

warp verify file.warp tests and proves the file's laws with Lean. warp types file.warp shows the program in W0, warp's type model proved in Lean, and compares the model's verdict and value with warp's own:

W0: [.bind "x" .var none (.int (3)) false, …]
model: Accepted("int")
warp: Accepted

The first run builds the model, which takes minutes (card types-first-run).

Home

Philosophy •

data & code blocks

features

inventions

evaluation

reflection

W0 types, proved

keywords

standard library

use modules & cargo crates, script mode

iteration

switch & pattern matching

warnings & strict

tasks

time & units

html pages

the warp command

examples

todo : bad ideas and open questions

⚠️ specification and progress are out of sync

Clone this wiki locally