Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

batuta transpile

Transpile source code to Rust using detected external transpilers (Phase 2: Transpilation).

Synopsis

batuta transpile [OPTIONS]

Description

The transpile command invokes external transpiler tools (Depyler for Python, Decy for C/C++, Bashrs for Shell) to convert source code to Rust. It supports incremental transpilation, caching, and an interactive Ruchy REPL for exploratory conversion.

This is Phase 2 of the 5-phase pipeline. It requires Phase 1 (Analysis) to be completed first.

Options

OptionDescription
--incrementalEnable incremental transpilation (only changed files)
--cacheCache unchanged files to speed up re-runs
--modules <MODULES>Transpile specific modules only
--ruchyGenerate Ruchy (gradual typing) instead of pure Rust
--replStart interactive Ruchy REPL after transpilation
-v, --verboseEnable verbose output
-h, --helpPrint help

External Transpilers

Batuta auto-detects transpilers in your PATH:

ToolSource LanguageInstall
DepylerPythoncargo install depyler
DecyC/C++cargo install decy
BashrsShellcargo install bashrs
RuchyGradual typingcargo install ruchy

Examples

Standard Transpilation

$ batuta transpile

🔄 Transpiling source code...
  Tool: depyler (Python → Rust)
  Source: ./src
  Output: ./rust-output

✅ Transpilation completed successfully!

Incremental with Caching

$ batuta transpile --incremental --cache

Ruchy Mode with REPL

$ batuta transpile --ruchy --repl

# After transpilation, drops into interactive REPL:
# ruchy> let x = 42
# ruchy> println!("{}", x)

Specific Modules

$ batuta transpile --modules "auth,database,api"

See Also


Previous: batuta analyze Next: batuta optimize