3 ms·
> What Zig offers is the ability to write ordinary Zig and call that from C. You say that, but Zig appears to suffer from the exact same problem you point out
by MaulingMonkey 6y ago
> What Zig offers is the ability to write ordinary Zig and call that from C.
You say that, but Zig appears to suffer from the exact same problem you point out in my Rust code:
export
https://ziglang.org/documentation/master/#Exporting-a-C-Library https://ziglang.org/documentation/master/#Exporting-a-C-Libr...
Perhaps I'm mistaken. How do I directly call Zig's `std.debug.print` from C? Or Timestamp.unixEpoch as defined here? https://ziglang.org/documentation/0.7.1/#Doc-comments https://ziglang.org/documentation/0.7.1/#Doc-comments
There's a bunch of rust crates containing macros, binaries, and build scripts that cut down on Rust's boilerplate as well. While there are some rough edges and room for further improvement, I am far happier with Rust's C interop than I am with the C interop of most other languages. Zig might have a touch more polish, but the bit I originally quoted made Rust sound like it was a good order of magnitude worse than Zig at C interop, which I just can't agree with.
One of the very first things I did when learning Rust was write a test library and drop it into an existing C++ codebase. I've also experimented heavily with cross compiling it to pretty much anything I can get my hands on. It was a good time, not a bad one.