4 ms·
I think you are right. But as a proof of concept is an interesting read. I've work extensively with Rust and PyO3 and Maturin and even for a medium to large pro
by nhatcher 3y ago
I think you are right. But as a proof of concept is an interesting read. I've work extensively with Rust and PyO3 and Maturin and even for a medium to large project is great. I wrote a bit about that here:
https://www.nhatcher.com/post/rust-in-anger/ https://www.nhatcher.com/post/rust-in-anger/
- wiktor-k 3y agoI'd also recommend PyO3 and Maturin. The amount of help these crates give is mind boggling (automatic type marshaling and even github CI jobs for creating cross platform precompiled wheels). I've created a library using this crate (https://github.com/wiktor-k/pysequoia/ https://github.com/wiktor-k/pysequoia/) and most of the time I could just focus on the problem domain instead of technical details of the bindings. There are just a couple of smaller issues (eg. Python to Rust async is not built in) but overall it's really nice.
- guitarbill 3y agoAgreed. It's also instructive to look at how C extensions are written for the CPython. I wouldn't necessarily expect a demo; but not mentioning it at all seems like it could lead readers down a path where they choose the "most performant" option presented (FFI + ctypes). The post has a "To go further:" link section where even a quick link to PyO3 would go a long way. So I thought I'd mention the downsides and an alternative on HN.