News for hackers. Stuff that matters.
Re:Calling Rust from Python by nhatcher on Sunday October 08, 2023 @04:02PM (#37813924)
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/

Re:Calling Rust from Python by wiktor-k on Sunday October 08, 2023 @04:12PM (#37813998)
I'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/) 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.

Re:Calling Rust from Python by guitarbill on Sunday October 08, 2023 @05:40PM (#37814655)
Agreed. 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.