49 stable releases (4 major)
| 4.1.1 | Feb 15, 2026 |
|---|---|
| 3.24.0 | Jan 30, 2026 |
| 3.20.0 | Nov 12, 2025 |
| 3.19.29 | Oct 29, 2025 |
| 0.3.1 | Jul 7, 2025 |
#155 in #transpiler
35 downloads per month
Used in 9 crates
17MB
411K
SLoC
Depyler Core - Transpilation Engine
Core transpilation engine for converting Python code to Rust and other targets.
Overview
This crate provides the fundamental transpilation pipeline that converts Python source code into target languages (Rust, Ruchy) while preserving semantics and ensuring memory safety.
Example
use depyler_core::DepylerPipeline;
let pipeline = DepylerPipeline::new();
let python = r#"
def factorial(n: int) -> int:
if n <= 1:
return 1
return n * factorial(n - 1)
"#;
match pipeline.transpile(python) {
Ok(rust_code) => println!("Generated:\n{}", rust_code),
Err(e) => eprintln!("Error: {}", e),
}
Architecture
The transpilation pipeline consists of several stages:
- Parsing (
ast_bridge) - Convert Python source to AST - HIR ([
hir]) - Transform AST to High-level Intermediate Representation - Type Analysis (
generic_inference,const_generic_inference) - Infer types and generics - Ownership Analysis (
borrowing,lifetime_analysis) - Determine ownership patterns - Optimization (
optimization,string_optimization) - Apply optimizations - Code Generation (
codegen,rust_gen) - Generate target code
Key Types
DepylerPipeline- Main entry point for transpilationTranspileOptions- Configuration options- [
Hir] - High-level intermediate representation TranspilationBackend- Backend trait for target languages
Dependencies
~14–32MB
~437K SLoC