Skip to content
0:00 / 0:00

#pyo3#ffi#pythonbindings

PyO3: From Python to Rust and Back Again (with David Hewitt)

Developer Voices

35K subscribers • 16 videos on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • Presented by David Hewitt, principal committer to PyO3
  • Linked in the descriptionPyO3/pyo3sparckles/Robyn

Intermediate. Assumes working knowledge.

23K views2 years ago2 recommendations

Programming languagesSystems programmingPythonRust

David Hewitt explains how PyO3 bridges Python and Rust, detailing the performance benefits and underlying mechanics.

There’s huge pressure on Python at the moment to get faster, ideally without changing at all. One increasingly–popular way of achieving that impossible task is to push the performance critical code down into C, C++, or Rust. And this week we’re focussing on the Python route, as we take a look at PyO3. David Hewitt’s the principal committer to PyO3, and he joins us to go through the easy parts, the hard parts, and the works in progress, giving us an insight into how Python and Rust work under the hood, and quite how much work it takes to make them work as one. – Become a Supporter on Patreon: patreon.com/DeveloperVoices Become a Supporter on YouTube: youtube.com/@DeveloperVoices/join PyO3 User Guide: pyo3.rs/v0.22.0/ PyO3 on Github: github.com/PyO3/pyo3 Polars: pola.rs/ Tokio: tokio.rs/ Trio: trio.readthedocs.io/ Robyn: github.com/sparckles/Robyn Faster CPython: github.com/faster-cpython Maturin: maturin.rs/ David on Mastodon: fosstodon.org/@davidhewitt David on Twitter: x.com/davidhewittdev Kris on Mastodon: mastodon.social/@krisajenkins Kris on LinkedIn: linkedin.com/in/krisjenkins/ Kris on Twitter: x.com/krisajenkins -- Intro How David Got Involved in PyO3 So Starting With Python To C... Taking That To Rust Calling Rust from Python Understanding PyO3's Place In The Stack Memory Safety Rust's Lifetimes Applying Lifetimes to Python Code Let's Get Into Error Handling The Performance Cost Threading David's Motivations Supporting Python's Sub-Interpreters The Limits of Compile-Time Guarantees Getting Started with PyO3 Outro

Why it's here

2 people recommend this

What people say. Highly recommended as one of the best explanations of how Python and Rust interact under the hood.

u/FJ_Sanchezin r/rust • Recommends

On “How *exactly* does Python and Rust work together?”

I would highly recommend watching this video if you want to understand what better how Python and Rust interact. It's probably one of the best videos I've watched lately about languages and software link to this video

u/FJ_Sanchezin r/rust • Recommends

On “What is lacking in the Rust ecosystem (2024)?”

You should watch this and thank me later: link to this video

u/40sMidLifeCrisisin r/rust • Recommends

On “What is lacking in the Rust ecosystem (2024)?”

You should watch this and thank me later: link to this video

u/40sMidLifeCrisisin r/rust • Recommends

On “How *exactly* does Python and Rust work together?”

I would highly recommend watching this video if you want to understand what better how Python and Rust interact. It's probably one of the best videos I've watched lately about languages and software link to this video