Libraries Run Rust Inside Python (With PyO3)
lumpa
62 points
33 comments
September 13, 2026
Related Discussions
Found 5 related stories in 72.8ms across 6,460 title embeddings via pgvector HNSW
- 'Rust makes coding fun again': Why Linux is moving away from C, says Greg KH arto · 21 pts · July 22, 2026 · 48% similar
- Async Rust vs RTOS showdown (2022) kooi · 71 pts · September 02, 2026 · 47% similar
- We're Building Postgres in Rust. Using the LLVM of Databases polyrand · 75 pts · July 16, 2026 · 47% similar
- How Our Rust-to-Zig Rewrite Is Going jorangreef · 467 pts · July 16, 2026 · 46% similar
- GPU Offload in Rust: Portable, Safe, and Fast linggen · 185 pts · August 17, 2026 · 46% similar
Discussion Highlights (9 comments)
the__alchemist
This is a nice party trick! I use it to provide easy installation of software that is written in rust, but is primarily used by Python users. (e.g.: Biology tools) They can do `pip install <name>`, since some people prefer this over downloading executables/installers. Bonus: Maturin/PyO3 can build "manylinux" binaries automatically, which helps with the Linux ABI diaspora.
simonw
I was a bit nervous about this trend when it started picking up because I care about Pyodide (Python running via WebAssembly) and libraries that use PyO3 might not work in Pyodide. Thankfully that's now been mostly solved - you can compile and publish WASM builds of Rust or C extensions on PyPI now and a Pyodide can then use them. Here's the WASM build of the Rust-including Pydantic-core package for example: https://pypi.org/project/pydantic_core/#pydantic_core-2.49.0...
roywiggins
> reach for, a Rust extension does the work ai; dr, sorry
skeledrew
But does it work everywhere Python works? My main issue with this Rust move has always been compatibility. Python can be embedded and ran in a heck of a lot of places. What's the story when libraries that I may want to depend on are actually implemented in Rust and my target doesn't/can't handle the toolchain and there's no build target?
hk1337
Why not just run C inside of Python?
throwaway63467
They’re not running Rust they’re running machine code compiled with the Rust compiler. Like many other Python libraries such as numpy are running machine code compiled with C++, C or Fortran. That was always the case for Python and is its main selling point, it’s a slow but easy to write glue language that can make faster native code scriptable. Also the article reeks of AI slop, it’s just trying to sell you a Rust course.
WD-42
It’s time to start figuring out how to block domains on hacker news. This slop is getting out of control. Who can read this? The first few sentences already induced a migraine.
startup_zombie_
How much of the existing PyPI ecosystem do you think could realistically work this way without package authors doing anything specifically for WASM?
AlienRobot
This is for WASM, but you can also do it to use a Qt frontend via Python's PySide6 with a Rust backend, avoiding the need of Rust bindings for Qt.