News for hackers. Stuff that matters.
Re:Rust for Windows by steveklabnik on Thursday January 21, 2021 @02:59PM (#25863419)
Anything not defined in Rust needs to be marked as unsafe, because Rust cannot understand non-Rust code. FFI bindings are inherently unsafe.
Re:Rust for Windows by ywei3410 on Thursday January 21, 2021 @05:39PM (#25865536)
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.

Re:Rust for Windows by steveklabnik on Friday January 22, 2021 @10:22AM (#25872367)
My 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.
Re:Rust for Windows by cetra3 on Thursday January 21, 2021 @07:04PM (#25866473)
I think maybe the ZeroMQ rust crate as a case study is something that is non-trivial: https://github.com/erickt/rust-zmq
Re:Rust for Windows by eska on Friday January 22, 2021 @01:49AM (#25869123)
Re:Rust for Windows by sensitive-ears on Thursday January 21, 2021 @06:13PM (#25865936)
It'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.