5 ms·
translate-c is not required for compiling pure Zig code. However, the plan is to remove the "@cImport" built in. So if your project is importing a c header, i
by Laremere 2y ago
translate-c is not required for compiling pure Zig code. However, the plan is to remove the "@cImport" built in. So if your project is importing a c header, in the future you'll add build step translating it from c to Zig, and then you import it into your Zig code as a module.
- fuzztester 2y agowhat is the reason for this change? zig less than newbie here. I've only just recently started reading the zig overview, although I have been reading hn posts about zig with interest for some time.
- Laremere 2y agoPrimary reason is that it removes a dependency on libclang, and as such is required to remove the LLVM dependency.
- 6keZbCECT2uB 2y agoHow does this work with things which are expressible only in C? For example, Pascal strings with flexible array members? I guess since you said header, you keep everything opaque and create a header for that which gets translated to Zig.
- girvo 2y agoIt's super exciting. c2nim is one of the things that makes using Nim in _super_ odd places (like professional embedded firmware development) feasible, and translate-c brings Zig that much closer to what I'd love from it! Embedded Zig is going to be rad, once we get there.