Calling Rust from Python using PyO3
saidvandeklundert.net
Calling Rust from Python using PyO3
1–10 of 51 posts
Re: Calling Rust from Python using PyO3
#2I hope someone creates a rule set for Bazel to automate this stuff. This seems like a really nice way to start rewriting performance critical code in a safe language!
Re: Calling Rust from Python using PyO3
#3This is smart thinking. Python is the world's best glue language and Rust is on track to become the world's best compiled, safe language.
It makes sense to combine the two and replace C in this.
Re: Calling Rust from Python using PyO3
#4https://pypi.org/project/blake3 has been based on PyO3 for about a year and a half now, and it's been smooth sailing. One of the reasons we reach for compiled code from Python is to get multithreading working for CPU-bound tasks, and the combination of PyO3 plus Rayon on the Rust side is especially nice.
Re: Calling Rust from Python using PyO3
#5PyO3 is a clever name
Re: Calling Rust from Python using PyO3
#6PyO3 is a clever name
I don't get it. What's the pun?
Re: Calling Rust from Python using PyO3
#7Re: Calling Rust from Python using PyO3
#8Re: Calling Rust from Python using PyO3
#9Re: Calling Rust from Python using PyO3
#10I hope someone creates a rule set for Bazel to automate this stuff. This seems like a really nice way to start rewriting performance critical code in a safe language!
I’ve been having difficulty recently trying to get bazel and rust to work together nicely.
It seems like cargo does a lot of heavy lifting w.r.t. dependencies which Bazel does not like. Do you have to vendor your dependencies- and your dependencies dependencies. Ad infinitum.
There is cargo-raze which helps, but only if you’re making a rust library: not if you’re making a binary.
So maybe it works for this case.