No outside access
A rule cannot read files or reach the clock or the network.
A programming language for your application's decision rules.
Write the judgments your app makes, like a publisher's house style, as code. Run them from your app to get an answer.
This rule moves a heading to the next page when fewer than 2 lines are left below it. Try it with a page that has 1 line left.
(let ((lines-left 1))Give a name to the number of lines left on the page.
(if (< lines-left 2)Check whether that number is less than 2.
"next-page"
"keep"))Choose the first answer when the condition is true, or the second when it is false.
"next-page"The heading moves to the next page.
Change 1 to 2 to get "keep", meaning the heading stays on this page.
Run this example →In a typesetting app built with Topaz, the engine breaks lines and lays out pages. Judgments that change from publisher to publisher, such as where a chapter starts or how many lines a heading needs below it, live in Lispex rule files. The app runs those rules with the evaluator that ships with Topaz.
The rule above runs unchanged in that evaluator and gives the same answer.
A rule cannot read files or reach the clock or the network.
When a rule reaches its work or memory limit, evaluation stops there and the app receives that result.
The same rule, input, and limits give the same answer every time the book is set again.
Lispex Vouch records a rule's decision so someone else can check it later. For example, a publisher can record the chapter-start decisions for the edition it sends to the printer.
The publisher runs its house style rule on input from the manuscript.
Native signs a record of the rule, input, and answer.
The recipient checks the signature with a trusted public key and runs their own rule with their own input.
The rerun answer is compared with the recorded answer and with the decision the recipient requires.
Vouch checks that the record and the rerun agree. The calling application decides what to do next.
Signing, rerunning, and comparing run in Native.
Use Lispex Vouch →Run code in the Playground with no installation. Everything stays in your browser.
Open the Playground →Call rules from Node.js with the lispex npm package.
Run Lispex in your application →Run files from the command line on your computer, set work and memory limits, and sign Vouch records.
Downloads →A Topaz application calls rules through the evaluator that ships with Topaz. Lispex needs no separate installation.
Run in Topaz ↗A Lispex Image stores the exact bytes of a source file in a PNG. This image holds the first example on this page. Decode the unchanged file on your computer or in the Playground to get the source back, comments and spaces included.

Only the exact original file decodes. A screenshot, a resized copy, or a re-saved file is rejected.
Create and read Lispex images →Go from your first program to your first decision rule in six lessons, then connect it to your application.