3 ms·
It would be nice if something in Zig could auto-magically generate the zig to c interop call and type declarations. I see there's "translate-c" to help migrate
by convivialdingo 3y ago
It would be nice if something in Zig could auto-magically generate the zig to c interop call and type declarations.
I see there's "translate-c" to help migrate C to Zig, and maybe that's enough.
Generally I fall on the side of if a compiler can toss out a type warning, it could certainly give a reasonable solution also. Best-guess with a "// Warning type was guessed" is better than an opaque "RTFM" in most every case.
- throwawaymaths 3y ago> It would be nice if something in Zig could auto-magically generate the zig to c interop call and type declarations. Do you mean building a .h file from zig code? The other direction is just @cImport.
- wredue 3y agoIf you watch some of the zig streams, there are some C libraries that are quite complex for importing. It’s not always just an @cImport. I wouldn’t so much pin this on zig as much as the complete clusterfuck that is building c libraries.
- throwawaymaths 3y agoOh sure, was just curious what feature gp was looking for. I would love the first one for example