deltachat-core-rust
deltachat-core-rust copied to clipboard
Consider using safer-ffi for autogenerating ffi bindings
I have switched recently my usage for binding generations to use https://github.com/getditto/safer_ffi/, and am quite happy. It removes almost entirely the need to write unsafe code in the binding layer, as the library handles most of it, and works considerably better than bindgen in my experience.
cc @r10s @link2xt
Would this be a api-breaking change or is a drop in replacement possible? looks already nice that it takes over doc comments :star_struck:
Not sure it's worth additional dependencies and increased compilation time. I'm more confident in our use of unsafe than in use of unsafe in the code generated by safer_ffi macros. If something breaks, there is a single maintainer to rely on.
Can't say I understand this code and will be able to fix it if I need to do it myself: https://github.com/getditto/safer_ffi/blob/c7c410e6c86eb7905f73b908fd36db0b3437176b/src/proc_macro/derives/handle_fptr.rs
i agree with @link2xt , also to me, our current approach looks better understandable, and adding new stuff was never an issue iirc. also, who knows, maybe we kill cffi at some point completely :)
closing as there is no actionable item, discussion can continue, of course.