Interop

Interop Boundaries

Choose a generated product or separately owned host integration without introducing foreign syntax to Topaz.

Interop is a build and product boundary, not a second language inside Topaz. Keep application logic in checked .tpz modules, select the product that fits the deployment environment, and review any surrounding host code separately.

Choose the boundary

NeedChooseWhat crosses the boundary
One executable for the build machine's OS and architectureRust BackendA managed native product built through Cargo
A product for an environment with Python 3.11 or newerPython BackendGenerated program.py with its bundled runtime
A browser or Worker productWASM & PlaygroundA managed Web artifact and its declared ABI
A custom Rust, Python, or service wrapperHost integrationGenerated product plus separately owned host code
A decision rule that runs inside your applicationRun Lispex RulesManifest, rules, limits, lock, typed results, and consumer evidence
One Lispex evaluator requestLispex Evaluator and LITCanonical rule, input, limits, result, and report
Exercise Topaz with the LIT programLispex Evaluator and LITLispex test and integration surface across four named routes
Source conversion involving Lena CodeLena Code InteropA separately maintained conversion workflow

The installed evaluator is a Topaz command surface, while output targets use the separate build --target surface. LIT exercises the test and integration routes, and Lena Code owns source conversion. Each route is listed by its product boundary.

What stays Topaz

Modules, imports, expressions, types, patterns, and primary diagnostics remain Topaz. There is no import rust, inline Rust, Python, or JavaScript expression, implicit ABI, automatic ownership conversion, or automatic host-exception translation. Generated source is an artifact, not permission to place its tokens in a .tpz file.

Verify only shared observables

Check and run the Topaz package first. Build the selected target, then run the managed product with the same declared input. Compare the observable relevant to the application—such as stdout, an exit code, an artifact field, or a file result—rather than internal object layout or generated source structure.

Treat the result as evidence scoped to that specific program, input, environment, and declared observable. Review the generated product and host integration again when the compiler or deployment target changes.

Host ownership remains explicit

A wrapper around a generated product is foreign code requiring its own dependency, ownership, error, capability, and security review. Importing a Topaz or standard module does not grant filesystem, network, process, environment, clock, or database authority. Unsupported target behavior must fail loudly instead of silently altering the checked program.

Continue with Rust Backend, Python Backend, or Lispex Evaluator and LIT.