[Question] Integrating Python to Rust

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • RustPython

    A Python Interpreter written in Rust

  • I was planning to achieve this by converting the Python code to C code, with Cython, compile it and call the compiled functions on the Rust code. As far as I went seaching about it, it seems possible. Despite being a possible solution, this would be a hassle, this would be my first time using Cython and making a Rust bind to C code, so I tried to find an easier solution by trying to compile Python code to Rust code or something in this direction. I'm not sure if any of the projects I found would do what I'm looking for. I found RustPython, which has an experimental JIT that compile Python functions to native code but the usage is still in Python code, not in Rust code. Another project I saw was the ct_python which apparently Run's Python code at Rust compile time and replaces the ct_python! macro with the Python code output, that again doesn't match my intentions.

  • circuitpython

    CircuitPython - a Python implementation for teaching coding with microcontrollers

  • If the CPython interpreter is too heavy for you to embed, you may want to check out https://circuitpython.org/ which is designed for using Python on embedded devices

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • PyO3

    Rust bindings for the Python interpreter

  • https://pyo3.rs is the most popular solution

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts