Interop

Code Analysis and Conversion with Lena Code

Lena Code is a code analysis platform built on a deterministic pipeline. Understand, improve, and transform code across 30 languages.

Lena Code is a code analysis platform built on a deterministic pipeline. Understand, improve, and transform your code across 30 languages. Explain and Review work with code in its own language. Convert translates code into a chosen language.

For conversion, put your code in the input editor, choose an available target language, and review the code in the result editor.

Check the language choices available in the workspace before starting. When those choices include Topaz, use the steps below to check the Topaz source or result.

Install Topaz to check and run generated .tpz files. Native builds also need the Rust build tools.

Generation and deterministic validation

Lena Code's technical foundation includes Lena, its own Lisp dialect, and Facet IR, a structured intermediate representation of code. Its team has built code analysis and conversion tools, interpreters, and a verification corpus. These assets support code analysis, generation, conversion, and deterministic result checking.

Prepare your conversion

Keep the original source, input data, and expected results alongside the converted code. Review changes to APIs, data representation, side effects, and error handling before using the result in your application.

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.

BASH
topaz parse converted.tpz
topaz check converted.tpz
topaz run converted.tpz
topaz build converted.tpz --out-dir converted-build --run
CommandResult to inspect
parseExit code 0 means the source parses
checkExit code 0 means name and type checks pass
runCompare the program's output and exit status with the original
build --runInspect 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.