Discover and explore top open-source AI tools and projects—updated daily.
paimlPython to Rust transpiler for efficient, safe code migration
Top 95.6% on SourcePulse
Summary Depyler addresses the challenge of migrating Python code to Rust for enhanced performance, memory safety, and energy efficiency. It targets engineers and researchers seeking to transition Python applications, offering semantic preservation, compile-time safety guarantees, and the ability to generate standalone native binaries.
How It Works The project utilizes a multi-stage pipeline: Python AST parsing (via RustPython), High-Level Intermediate Representation (HIR), conservative type inference, and Rust code generation. Key differentiators include semantic verification through property-based testing to ensure behavioral equivalence and memory safety analysis that infers Rust's ownership and borrowing patterns, aiming for correct and safe Rust code by construction.
Quick Start & Requirements
Installation is via cargo install depyler. Prerequisites include Rust 1.83.0+ and Python 3.8+ (for testing). The depyler compile script.py command generates a standalone native binary, supporting cross-platform builds and debug/release profiles. Links to CHANGELOG.md and validation reports are provided.
Highlighted Details
depyler compile for one-step Python-to-native binary creation across platforms.@rust.attr()) allow injecting Rust attributes (e.g., #[inline], #[derive(...)]) into generated code.argparse is transpiled to Rust clap derive macros.Maintenance & Community
The README does not specify community channels or contributors. A roadmap is available at docs/execution/roadmap.yaml.
Licensing & Compatibility Licensed under the MIT License, which is permissive for commercial use and closed-source linking.
Limitations & Caveats
Unsupported features include dynamic Python constructs like eval() and exec(), runtime reflection, multiple inheritance, and monkey patching.
1 day ago
Inactive
ezelikman