4 ms·
> - Compatibilty with C: That doesn't tell me much, because C++, D and Rust all have excellent C compatibility. Zig's @cImport/translate-c is significantly eas
by defen 6y ago
> - Compatibilty with C: That doesn't tell me much, because C++, D and Rust all have excellent C compatibility.
Zig's @cImport/translate-c is significantly easier to use than Rust's bindgen (though it's been a few years since I used bindgen) plus it can translate actual functions to Zig and not just declarations (e.g. inline functions)
- codeflo 6y agoI can totally believe that. My point is that a “why not X” article should explain why it’s better, not just name a feature that X nominally also has. (BTW, bindgen hasn’t changed that much. The expectation seems to be that people write a safe wrapper around the generated bindings anyway, so not a lot of effort goes into making them maximally convenient. I also don’t find that ideal.)
- atilaneves 6y agodpp* can't do function definitions yet but for declarations it's as easy as #including a C header file natively. * https://github.com/atilaneves/dpp https://github.com/atilaneves/dpp