Pierre Krieger outlines common safety pitfalls, API design mistakes, and memory leak issues when writing Rust wrappers around C libraries.
Do you need to perform a certain task in Rust? Why not pick a mature C library that already does what you want, and write a wrapping library around it?
Writing a wrapping library is sometimes not as easy as one could think, and you will probably make mistakes that will make you lose time or even make your wrapper unsound.
This talk will show you the most common safety problems you may not have thought of, such as leak safety, but will also give you advices on what not to do when designing the API of your library.
About Pierre Krieger:
After coding in C++ for about ten years, Pierre switched to Rust in 2014 and has been maintaining several game-development-related libraries. He specializes in graphics programming.
Why it's here
2 people recommend this
What people say. Recommended as an essential talk on the difficulties and safety assumptions of writing unsafe Rust wrappers.
Moments people linked to
X
u/Xanewokrlsin r/rust • Recommends
On “[GOOGLING HELP WANTED] Trying to find that cool talk about things you can't assume when writing unsafe code”
I think you want /u/tomaka17's "Mistakes to avoid when writing a wrapper around a C library" talk from RustFest Zurich: [video (coin flip example)