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
| Task | Start here | What you use |
|---|---|---|
| Run a desktop or server program | Rust Backend | A native executable built through Cargo for the build machine's OS and architecture |
| Call Topaz from a browser or Worker | WASM & Playground | A Web or Worker package with generated JavaScript bindings and type declarations |
| Add a custom Rust or service wrapper | Rust Backend | The generated product and your own calling code |
| Call decision rules from your application | Run Lispex Rules | A package with named rules, limits, quotas, and typed results |
| Evaluate one Lispex rule without a package | Lispex Evaluator and LIT | Rule, input, and limits files, followed by a result and report |
| Test the toolchain with the LIT interpreter | Lispex Evaluator and LIT | The same test program run directly, through generated Rust, and through Web |
| Convert source with Lena Code | Lena Code Interop | A 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
- Check and run the Topaz package with a known input.
- Build the selected target and give the built product the same input.
- Compare the results your application uses, such as stdout, exit code, output files, or a field returned to JavaScript.
- 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.