(Lispex)

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.

Decide where a heading near the bottom of a page goes.

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.

What the code means

  1. (let ((lines-left 1))

    Give a name to the number of lines left on the page.

  2.   (if (< lines-left 2)

    Check whether that number is less than 2.

  3.       "next-page"
          "keep"))

    Choose the first answer when the condition is true, or the second when it is false.

Result"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 →

Topaz calculates, Lispex decides.

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.

No outside access

A rule cannot read files or reach the clock or the network.

Stops at its limits

When a rule reaches its work or memory limit, evaluation stops there and the app receives that result.

Same rule, same answer

The same rule, input, and limits give the same answer every time the book is set again.

A decision should stay checkable after it is made.

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.

  1. 1. Rule

    The publisher runs its house style rule on input from the manuscript.

  2. 2. Signed record

    Native signs a record of the rule, input, and answer.

  3. 3. Rerun

    The recipient checks the signature with a trusted public key and runs their own rule with their own input.

  4. 4. Compare

    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 your rules where you need them.

Native

Run files from the command line on your computer, set work and memory limits, and sign Vouch records.

Downloads →

Topaz app

A Topaz application calls rules through the evaluator that ships with Topaz. Lispex needs no separate installation.

Run in Topaz ↗

Share source as an image.

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.

Lispex Image of the first example on this page. Download the PNG

Only the exact original file decodes. A screenshot, a resized copy, or a re-saved file is rejected.

Create and read Lispex images →

Write a rule for your own app.

Go from your first program to your first decision rule in six lessons, then connect it to your application.