Use Lena Code to convert source to or from Topaz when its support list includes your language pair. Check that list first, then compare the converted program's behavior with the original.
Lena Code is a separately distributed source-conversion tool. Install Topaz to check and run generated .tpz files. Native builds also need the Rust build tools.
Choose a supported conversion
At Lena Code, find your source language, destination language, and program shape in the current support list. Check the direction of conversion. Record the Lena Code version and keep the original source and expected results. For an input outside the list, choose another conversion method.
Check generated Topaz code
Save the converted source as converted.tpz and review its contents and changes before execution. From the folder containing that file, run these commands in order. Stop if a command fails.
topaz parse converted.tpz
topaz check converted.tpz
topaz run converted.tpz
topaz build converted.tpz --out-dir converted-build --run| Command | Result to inspect |
|---|---|
parse | Exit code 0 means the source parses |
check | Exit code 0 means name and type checks pass |
run | Compare the program's output and exit status with the original |
build --run | Inspect the product in converted-build and compare the built program's behavior |
If parsing or checking fails, edit converted.tpz at the reported location using the current syntax. If execution differs, use the same input in both programs and inspect the changed logic.
Compare outputs, errors, data changes, API calls, and failure handling that matter to your application. A successful source check does not test these results. Review file and network operations before giving the program access to real data.
Convert from Topaz
Lena Code defines how Topaz constructs map to the destination language and its execution environment. Check the generated APIs, data representation, external effects, and error handling. Run tests with the destination language's tools and compare the recorded results.
Integrate the result
The two products exchange source files. Set up the destination's packages, runtime, and deployment files separately. If you connect compiled components, check their ABI, the rules for passing arguments and results.
Keep foreign-language examples labeled with their language. .tpz files use Topaz syntax, and topaz check rejects unsupported forms.