Interop

Interop Boundaries

Choose native or Web output, call Lispex rules, and identify which code needs separate testing and permissions.

Choose how your Topaz application connects to another program or runtime. Use the table to find a native executable, a JavaScript interface, a Lispex rule call, or source conversion.

Start with a working Topaz package. The linked guides explain the files, tools, and inputs needed for each choice.

Choose by task

TaskStart hereWhat you use
Run a desktop or server programRust BackendA native executable built through Cargo for the build machine's OS and architecture
Call Topaz from a browser or WorkerWASM & PlaygroundA Web or Worker package with generated JavaScript bindings and type declarations
Add a custom Rust or service wrapperRust BackendThe generated product and your own calling code
Call decision rules from your applicationRun Lispex RulesA package with named rules, limits, quotas, and typed results
Evaluate one Lispex rule without a packageLispex Evaluator and LITRule, input, and limits files, followed by a result and report
Test the toolchain with the LIT interpreterLispex Evaluator and LITThe same test program run directly, through generated Rust, and through Web
Convert source with Lena CodeLena Code InteropA separately maintained source-conversion workflow

build --target selects the output to deploy. topaz lispex embed evaluates a rule. LIT is a repository test program. Choose the operation that matches your task.

Keep Topaz source in Topaz syntax

Write application logic in .tpz modules. Modules, imports, expressions, types, patterns, and diagnostics follow Topaz rules.

To connect foreign code, use the generated product's interface. Its ABI defines how arguments and results pass between programs. Topaz does not accept import rust or inline Rust or JavaScript expressions. Ownership and exceptions need explicit handling in the calling code. A generated source file does not extend .tpz syntax.

Check the result after integration

  1. Check and run the Topaz package with a known input.
  2. Build the selected target and give the built product the same input.
  3. Compare the results your application uses, such as stdout, exit code, output files, or a field returned to JavaScript.
  4. Repeat these checks when the compiler or deployment target changes.

Record the input, environment, and expected result so another developer can repeat the check. Internal object layouts and generated source structure can differ between targets.

Review calling code and permissions

The host is the program or environment that calls your Topaz code. Check your host wrapper's dependencies, ownership, error handling, and security separately.

Importing a module does not grant permission to use files, the network, processes, environment variables, the clock, or a database. Configure those permissions in the host where the operation runs. A target that cannot preserve a required behavior must report a failure instead of silently changing it.

Lispex rules run without file, clock, or network access. Their saved evaluation records are unsigned and do not authorize external actions. See Run Lispex Rules for resource limits and record handling.