Re:How to rewrite it in Rust
by paulddraper on Monday December 02, 2019 @11:46PM
(#21690007)
At some point, I figure you will always need human intervention to get actually idiomatic interop, whether it's C marshalling, JSON serialization, database persistence, etc.
Exactly, as much as I love writing Rust code, there is nothing that is more frustrating that maintaining bindings from C to Rust. Then you'd have to create another idiomatic binding on top of it. Sure bindgen is great, but Zig's cImport and Swift's ClangImporter take this further.
They both use clang modules to tackle the first part. A autogenerated idiomatic solution would be great for Rust, but sadly it doesn't exist.