Re:Calling Rust from Python
by forrestthewoods on Sunday October 08, 2023 @05:54PM
(#37814735)
> The C API might be able to be used anywhere, but that doesn't mean it's ergonomic, easy to use, or safe.
Definitely true. That said I think there is an under appreciated beautiy to a clean C API.
It’s easy to “upgrade” a C API with per-language/environment bindings. It can be near impossible to “downgrade” a high-level API to C.
Re:Calling Rust from Python
by yazaddaruvala on Monday October 09, 2023 @03:55AM
(#37818065)
And Rust just uses the C ABI, so wouldn’t your comments include “in Rust”?
The benefit is that you only need to ship the CPython extension, you can build it with cargo, and everything's in one place. I've maintained bindings for Python and C# to native libraries, and it's usually a pain for various reasons.
The C API might be able to be used anywhere, but that doesn't mean it's ergonomic, easy to use, or safe.