(Note: this is a cross-post from reddit)
I’ve already written a Rust FFI guide of sorts in the past and was thinking it’s time to revisit it, potentially rewriting sections or addressing new ideas/techniques, and wanted to get a feel for the things people would find useful.
The guide is mainly meant as a resource for people wanting to integrate Rust code with non-Rust code at the binary level (e.g. a C++ app calling into a Rust crate, or a Rust app pulling in a C DLL), pointing out common patterns and potential footguns.
As such, what sorts of things would people want to know about when writing FFI code? If you are trying to integrate a Rust DLL into something at work, are there any lessons or war stories you’d like to tell others about?
Also, feel free to let me know if you want to help out or otherwise contribute. I’d be happy to add you to the repo as a contributor!