Where Your Program Runs

Run a file with the default interpreter and choose the Playground, npm, or Native for your next task.

Choose where to run your next program. the browser, npm, or Native. Start with Lispex Interpreter, the default engine for running source.

First Program explains how to install a terminal product. You can also use the Playground without installing one.

Run a file with the default

Compare one and two remaining lines below a heading.

Save the program as rule.lspx.

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

With Native or npm installed, run this command in the same directory.

SH
lispex rule.lspx

Output

OUTPUT
(#t #f)

One remaining line is less than two, so the first answer is #t. Two lines give #f. The command exits with status 0 and creates no files. Pasting the same source into the Playground and running it gives the same answer.

Lispex Interpreter is called tree in command options and reports. It reads source and normalizes shorthand into core forms (CoreExpr) before evaluating them. It implements the complete language profile, the set of supported language features. It also serves as the reference for the language's behavior.

Pick the product for your next task

You want to…UseHow to run this example
try code in the browserPlaygroundpaste the source and run it
run files in a Node.js environmentnpm packagelispex rule.lspx
run a downloaded executableNativelispex rule.lspx

All three use Lispex Interpreter by default. The product is what you install or open. The execution method is how that product runs the program.

Native also offers Lispex VM, which executes compiled and verified Lispex bytecode. Lispex Interpreter and Lispex VM explains its purpose and comparison reports.

Try this

You installed the npm package and saved the example as rule.lspx. Which command runs it, and what two answers should appear?

Show answer

Run lispex rule.lspx. It uses Lispex Interpreter and prints (#t #f). The command exits with status 0 and creates no files.

Use the rule in your own project

You have finished this step when you can choose a product and run a file with its default interpreter. To try code in the browser, choose the Playground. For a terminal, choose npm or Native and use lispex rule.lspx.

To connect a rule to your application, continue with Run Lispex in Your Application. To compare implementations, read Lispex Interpreter and Lispex VM.