Running and Building
Run It at Once While Writing, Native When Shipped
lp9 run orders.lp9 while writing: runs at once
lp9 build orders.lp9 --out orders.exe to ship: makes a native executable
lp9 run runs the program on the spot, with no build to wait for. lp9 build makes a native executable to ship (the build uses the Zig toolchain).
The two give the same answers. The built executable defines the language, and the interpreter is held to it. Of the conformance programs, all 143 that must succeed run both ways with their output compared byte for byte; the 104 that must be refused have the wording of the refusal recorded. What was confirmed with run while writing holds for the executable that ships.
They differ only in speed and in how deep a recursion goes. The interpreter stops shallower, with the same message.
A built executable keeps checks such as an array index's range. A program that reads out of range stops, rather than quietly reading some other value.
How It Ships
One executable. No language runtime has to be installed on the user's machine. On Windows the SDL3 DLL goes beside it; on Linux the distribution's SDL3 is used.
Only what is used goes in. lp9 build links only the libraries inference found the program using. A program that does not use SQLite does not carry SQLite.
A program with a screen is a windowed application. Started from Explorer or the taskbar on Windows, it opens no console window. A program without a screen stays a console program.
The icon goes in the executable. When a screen's class points class >> icon at a .ico or .png, the build reads and embeds it.
Several tools can share one executable.
lp9 bundle --out tools.exe import.lp9 export.lp9 check.lp9
tools import
Each program gets its own namespace, and the first argument chooses which one runs.
Checking Screens Without a Window
A screen program can be given its input as arguments, and the frame it drew is written as a PNG. This works for lp9 run and for built executables alike.
lp9 run orders.lp9 --click 120,40 --text 受注伝票 --key Return --shot out.png--shot out.png | draw one frame to a PNG and exit |
--click x,y | press there; a|b|... presses each in turn |
--key k|k, --text s | press keys, commit text |
--preedit s, --cands a|b | an input method halfway through |
--drag dx,dy, --wheel N | drag, turn the wheel |
--files x,y=a|b | drop files there |
--file-dialog path | what a file dialog answers, as if chosen |
--size w,h | the window's size |
--frames N | run N frames before drawing |
While --shot is taken the clock stands still and --frames advances it a sixtieth of a second per frame, so even a screen that keeps moving draws the same picture every time, and run and build draw the same picture too.
A screen's behaviour can go into automated checks without anyone operating it. LP-9 checks 29 screens of its own this way, and every picture on this site was taken this way.
When It Stops
A windowed application started from Explorer has no standard error, so its run-time errors are shown in a message box.
On Windows, an access violation or a stack overflow prints where it happened before the process ends.