~/talk

How Python Harnesses Rust through PyO3

Talkat PyCon US 2024 · 2024-05-15..05-23· [python]
links:none on file
slides:none on file

Shows exact plumbing: Python import lands in the CPython call opcode which routes through PyObject_Vectorcall into a generated extern "C" trampoline that runs Rust code produced by PyO3+maturin build. Demonstrates argument layout (args array, nargs, kwtuple), conversion traits from PyObject to Rust types, and a real-case microbenchmark (the word-count example is ~2–4× faster). Explains safety work: a panic trap and deferred refcounts around the boundary, plus ecosystem scale (≈350 new Rust-backed packages/month and ~3 billion downloads/year), and real adopters like pydantic, polars, cryptography, and ruff.

AI-written summary · about

  1. 0:00PyO3 and talk intro
  2. 1:04Python and Rust synergy
  3. 7:20PyO3 goals
  4. 10:28Bridging Python and Rust
  5. 15:34Rust in Python growth
  6. 17:59Rewriting Python in Rust
  7. 18:20Python module from Rust
  8. 27:13Tracing Python to Rust
  9. 34:11Rust-Python safety boundary
  10. 39:05Key takeaways
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.