Techniques learned from five years finding the way for Rust in Python
summary
Five years of work on PyO3 yields concrete tactics: an API migration from borrowed references to smart pointers that improves performance and ownership soundness; procedural macro techniques that preserve source spans for precise diagnostics and deprecations; hacks for specialization like auto/d-specialization and a form of compile-time specialization using const generics; handling Python’s experimental free‑threaded GIL model and async bridging; ongoing limits from no stable Rust ABI, GC cycle handling, inventory linking and a scoped thread‑local soundness hole.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 1:28Rust in Python ecosystem
- 7:06Rust’s developer experience
- 10:18Compiler diagnostics
- 15:56Procedural macros in P3
- 23:59Advanced macro techniques
- 33:59Thread safety in Python 3.13
- 36:46Rust-Python limitations
- 44:16Key takeaways
- 44:43Q&A
related talks
36mPumping up Python modules using Rust
44mHow Python Harnesses Rust through PyO3
46mPython + Rust = ?
44mDo Pythons Rust? How we used PyO3 to build a Python Stream Processor w/ a Rust Heart
22mUsing Rust in Free-Threaded vs Regular Python 3.13
31mPumping up Python modules using Rust
35mUsing Rust to write Python modules
28mRust for Pythonistas
