4 ms·
On a side-note; do you know of any good resources where someone tries to wrap a non-trivial C wrapper where they go over common C idioms and ways to provide a (
by ywei3410 6y ago
On a side-note; do you know of any good resources where someone tries to wrap a non-trivial C wrapper where they go over common C idioms and ways to provide a (safer) API inside Rust without too much overhead?
I've always found it to be incredibly difficult because of the number of gotchas which can leak into causing a segfault in Rust; it's immensely frustrating.
- sensitive-ears 6y agoIt's more of an example than a resource, but the 'git2' crate that wraps libgit2 does a good job of providing a nice rust interface over a C library.
- cetra3 6y agoI think maybe the ZeroMQ rust crate as a case study is something that is non-trivial: https://github.com/erickt/rust-zmq https://github.com/erickt/rust-zmq
- eska 6y agohttps://medium.com/dwelo-r-d/using-c-libraries-in-rust-13961948c72a https://medium.com/dwelo-r-d/using-c-libraries-in-rust-13961...
- steveklabnik 6y agoMy co-author Carol Nichols gave a few talks on this a while back, but there's not a ton of resources, it's true. I would look at big libraries and see what they do. I know it's not the best thing, but it's probably the best that exists right now.