3 ms·
I haven't used it yet, but apparently Rust's FFI with C (in both directions) is quite good: https://doc.rust-lang.org/book/ffi.html https://doc.rust-lang.org/b
by dikaiosune 11y ago
I haven't used it yet, but apparently Rust's FFI with C (in both directions) is quite good:
https://doc.rust-lang.org/book/ffi.html https://doc.rust-lang.org/book/ffi.html
- steveklabnik 11y agoIn fact, we removed language features in order to gain a zero-cost interop.
- muflax 11y agoWhich ones?
- steveklabnik 11y agoGreen threads.
- chubot 11y agoThat doesn't do IPC though right? When I say IPC, I mean where you have a Rust process and and a C/C++ process running with different privileges. When people say FFI, they mean Rust code and C code running in the same process. I thought Chromium had a library for this (for multiple C++ processes), but I guess it is sort of ad hoc now? https://www.chromium.org/developers/design-documents/inter-process-communication https://www.chromium.org/developers/design-documents/inter-p... https://www.chromium.org/Home/chromium-security/education/security-tips-for-ipc https://www.chromium.org/Home/chromium-security/education/se...
- steveklabnik 11y agohttps://github.com/pcwalton/gaol https://github.com/pcwalton/gaol
- chubot 11y agoThis seems like a great start, but it would be far more useful if there was a C/C++ side. I only see Rust examples, which makes me think it is for Rust <-> Rust communication. Though it's great to see this, because just rewriting in Rust -- while fantastically expensive -- isn't necessarily enough. You need multiple security measures. The grandparent comment was mistaken about this.