2 ms·
Thanks. I didn’t actually realize Zig is itself a C compiler. Rust has pretty great support for the C ABI based on my usage. Using both the bindgen and the cbi
by bluejekyll 6y ago
Thanks. I didn’t actually realize Zig is itself a C compiler.
Rust has pretty great support for the C ABI based on my usage. Using both the bindgen and the cbindgen tools to import/export C ABI, is really simple. The Rust language is committed to always supporting the C ABI, where functions and types are marked as such, for example: 'extern "C" fn', and for types '#[repr(C)]'
Thank you for the links to Zig.
- AndyKelley 6y agoThere's nothing stopping Rust from doing exactly what Zig does with also being a C compiler. It's not so much a language feature as it is a compiler feature. In fact you might even say that Zig paved the way for Rust to do exactly this. I think it's pretty in line with the goals of the project and I wouldn't be surprised if they decided to go for it. It's pretty fun because Rust was a huge inspiration for Zig, and so for it to turn around and then offer improvements back to Rust is a beautiful cycle :)