4 ms·
Since most system level api provide a C interface and the c interoperability of zig is top notch you don’t require a marshaling/interop layer.
by SvenL 1y ago
Since most system level api provide a C interface and the c interoperability of zig is top notch you don’t require a marshaling/interop layer.
- bigstrat2003 1y agoThat's true of Rust as well, so it's not really an advantage unique to Zig.
- SvenL 1y agoIs it? Most of the time I read you have to create a wrapper, like here: https://docs.rust-embedded.org/book/interoperability/c-with-rust.html https://docs.rust-embedded.org/book/interoperability/c-with-... Please provide some documentation of how to use c libraries without such interop layer in rust. And while bindgen does most of the work it can be pretty tedious to get running.
- smj-edison 1y agoFrom what I've seen, it also has much less of an impedence mismatch. You can sling pointers around to your heart's desire in Zig, whereas in Rust you have a lot of sanitization and restructuring when going crossing the barrier.