
Developing PyO3 to bring Rust 🦀 and Python 🐍 together. Working with the team at Pydantic to build software that developers love. @davidhewitt@fosstodon.org
- Tweets153
- Following108
- Followers922
- Likes164

ALT Conference talk slide describing the project structure of a Rust + Python library for simulating electromagnets. Two repos; publish Rust crate and Python lib separately. Off-the-shelf CI: - Rust: release-plz and cargo-semver-checks (SemVer linting reduces downstream debugging at near-zero cost!) - Python: PyO3/maturin, mixed native project One-line build Downsides are fairly minor (duplicating documentation, split repos) When to push features back from Python to Rust? - NOT "when I will save more time in my current workflow than it takes to rewrite" - Workflows change with performance: "What would you do if it were faster, that isn't being done now?" Prototype in Python/numpy (??? hrs), then rewrite it in Rust (15min - 2hrs), then add bindings back to Python (15-45min to write PyO3 Rust glue, ~15min to write symmetric Python bindings)





















