depyler
Compiles Python to Rust, helping transition off of Python to Energy Efficient and Safe Rust Code
claude mcp add --transport stdio paiml-depyler python -m depyler
How to use
Depyler is a Python-to-Rust transpiler with built-in semantic verification and memory safety analysis. It translates annotated Python code into idiomatic Rust, preserving semantics while providing compile-time safety guarantees. The tool supports a single-command workflow to compile Python into native binaries, and it can also transpile Python to Rust code for further inspection or custom tooling. Use the Depyler CLI to either compile to a binary or to generate Rust source, with optional verification to ensure behavioral equivalence.
To use Depyler, install the binary via cargo install depyler (see installation steps). Once installed, you can run commands such as depyler compile script.py to produce a standalone binary, or depyler transpile example.py to generate Rust code. You can also enable semantic verification with depyler transpile example.py --verify. The resulting Rust code or binary is designed to retain the original program semantics while leveraging Rust’s safety guarantees.
How to install
Prerequisites:
- Rust toolchain (1.83.0 or later)
- Python 3.8+ (for test validation)
Installation steps:
- Install the Depyler cargo binary:
cargo install depyler
- Verify installation:
depyler --version
- Optional: Install tooling or dependencies for tests as described in the repository (e.g., Python tooling, if you plan to validate Python samples).
Notes:
- The installation requires a Rust toolchain compatible with cargo install. Ensure your environment has Rustup configured and cargo available in PATH.
- For test validation, Python 3.8+ may be required depending on the repository’s test suite.
Additional notes
Tips and caveats:
- Depyler specializes in type-directed transpilation, memory safety analysis, and semantic verification. Enable verification to catch behavioral differences between Python and Rust implementations.
- The tool ships with support for a broad subset of the Python standard library (27 modules validated). If your Python code relies on dynamic features or runtime reflection, anticipate possible limitations.
- When compiling to a binary, you’ll obtain a standalone executable suitable for distribution. Use transpile when you want to inspect or customize the generated Rust code.
- If you encounter environment-specific issues, ensure your Rust toolchain and Python environment paths are correctly configured in your shell (PATH, PYTHONPATH).
- The MCP server configuration can be extended to multiple servers if you need parallel services; the provided example defines a single server named depyler.
Related MCP Servers
ReActMCP
ReActMCP is a reactive MCP client that empowers AI assistants to instantly respond with real-time, Markdown-formatted web search insights powered by the Exa API.
jmeter
✨ JMeter Meets AI Workflows: Introducing the JMeter MCP Server! 🤯
pfsense
pfSense MCP Server enables security administrators to manage their pfSense firewalls using natural language through AI assistants like Claude Desktop. Simply ask "Show me blocked IPs" or "Run a PCI compliance check" instead of navigating complex interfaces. Supports REST/XML-RPC/SSH connections, and includes built-in complian
cloudwatch-logs
MCP server from serkanh/cloudwatch-logs-mcp
mcp-loxone
An opinionated Model Context Protocol (MCP) server for controlling Loxone home automation systems.
servicenow-api
ServiceNow MCP Server and API Wrapper