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

Custom Transpiler Flags

Batuta orchestrates external transpilers (Depyler, Decy, Bashrs) detected via PATH. You can pass additional flags to each tool through configuration or the CLI.

CLI Flag Passthrough

Use -- on the command line to forward flags directly to the active transpiler:

# Pass flags to Depyler during transpilation
batuta transpile -- --strict --no-docstrings

# Pass flags to Decy
batuta transpile --tool decy -- --no-inline --warn-unsafe

# Pass flags to Bashrs
batuta transpile --tool bashrs -- --posix-only

Everything after -- is forwarded verbatim to the selected transpiler binary.

Per-File Flag Overrides

The modules array in [transpilation] selects which modules to transpile. Combine it with CLI passthrough to apply different flags per module:

batuta transpile --modules core -- --strict
batuta transpile --modules utils -- --permissive

Depyler Flags

Config KeyCLI EquivalentEffect
type_inference--type-inferenceInfer Rust types from Python hints
numpy_to_trueno--numpy-to-truenoMap NumPy to Trueno SIMD ops
sklearn_to_aprender--sklearn-to-aprenderMap sklearn to Aprender
pytorch_to_realizar--pytorch-to-realizarMap PyTorch to Realizar

Decy Flags

Config KeyCLI EquivalentEffect
ownership_inference--ownership-inferenceInfer ownership from pointer usage
actionable_diagnostics--actionable-diagnosticsEmit fix-it diagnostics
use_static_fixer--static-fixerApply automatic C pattern fixes

Bashrs Flags

Config KeyCLI EquivalentEffect
target_shell--shell bashTarget shell dialect
use_clap--use-clapGenerate clap-based CLI

Plugin Hooks

For custom processing steps, register a plugin through the Batuta plugin API. Plugins receive the transpiled source and can transform it before the optimization phase.

#![allow(unused)]
fn main() {
use batuta::plugin::{TranspilerPlugin, PluginRegistry};

let mut registry = PluginRegistry::new();
registry.register(Box::new(MyPostProcessor))?;
}

Plugins integrate as pipeline stages with access to the full PipelineContext. See Plugin Architecture for the complete API.


Navigate: Table of Contents