7 comments

[ 2.9 ms ] story [ 36.3 ms ] thread
(comment deleted)
`@cImport` is dead, apparently, so the example should be updated.
Stop the misinformation, it’s just changing where it’s being done moving from the language to the build system itself: https://ziggit.dev/t/cimport-going-away/5132

It’s also decoupling Zig compiler and C compiler so they’re updated independently.

It’s still a bummer in my view as I just replaced my build pipelines with just a Zig compiler instead of emscripten but that’s fine.

"No no he's not dead, he's, he's restin'!"

@cImport is moving to the build system in an upcoming version (0.17, I think?). It's inconvenient, but it's unfortunately necessary.

The issue with @cImport is that when and the order the imports occur are almost impossible to define if you have multiple files and libraries. By moving it to the build system, the order now becomes deterministic and you can refer to it properly.

@cImport is dead. It's not moving anywhere, it's being deleted.

The build system allows you to expose C libraries as Zig modules that can be imported with the normal @import builtin.

It seems the world is tired of waiting for Zig to reach stability and has decided to start using it.