Run Lispex in Your Application

Run a Lispex rule in the browser or terminal and read its result. Then choose how your application supplies input and receives the answer.

Open the Playground to try a rule. To run a file, install Native or npm with First Program. File execution uses the Lispex Interpreter by default.

Run one complete rule

Save this complete program as rule.lspx.

LISPEX
(list (< 1 2) (< 2 2))

With Native or npm installed, run it from the same directory.

SH
lispex rule.lspx

Output

OUTPUT
(#t #f)

The command exits with status 0 and creates no files. One remaining line is less than two, so the first answer is #t. Two lines give #f. You have now run the rule and read its answer.

Choose where to call it

TaskStart hereWhere to read the result
Try source in the browserPlaygroundOutput and diagnostics beside the editor
Run a source file in the terminalNative or npm, installed with First ProgramStandard output, diagnostics, and exit status
Call Lispex from Node.jsThe lispex npm packageThe package API's returned result

These products use the same Lispex Interpreter for ordinary source evaluation. The Product Catalog lists their additional features. For SICP lessons, use the separate SICP learning guide.

Pass input from your application

For a decision rule with JSON input, follow Running and Checking Decision Records. Your application supplies the source, input, and resource limits. The command writes the result and a readable summary into a new directory.

For direct evaluator calls, follow Run a Rule Within Set Limits. That guide creates the complete source and binary input, evaluates the rule, and inspects the result. The calling application decides what external action to take from that result.

For a Topaz application, follow Run Lispex Rules. Topaz supplies the application API and defines its package and deployment requirements.

Set a resource profile

A resource profile specifies execution limits. Choose the evaluator according to the language features your rule needs.

Command familyLanguage profile
lispex embedDecision language profile
lispex embed fullComplete current language profile, including 205 built-in procedure entries

These are separate evaluators with their own binary interfaces and result formats. Both use WASM components with no imports and create a fresh instance for each request. They account for preparation and evaluation separately and produce a portable core record binding one execution. See the evaluator reference for the interfaces and limits.

Save bytecode

Use Bytecode and Deployment to save and execute compiled instructions.

Compare implementations

To investigate differences in results, output, or diagnostics, follow Compare Implementations. That path explains the required products and comparison reports.