ImportC + nuklear = success!

Chris wendlec at tcd.ie
Tue Jun 28 13:41:20 UTC 2022


On Tuesday, 28 June 2022 at 12:44:39 UTC, Max Samukha wrote:
> On Monday, 27 June 2022 at 13:58:32 UTC, Chris wrote:
>
>>
>> [1] https://zig.news/xq/zig-build-explained-part-3-1ima
>
> That's interesting. Unfortunately, I cannot afford to switch to 
> Zig.

Zig supports C integration quite well[1]. But Zig is a bit more 
finicky than, say, GCC when it comes to undefined behavior[2], if 
you use the approach above. You can also compile C code with `zig 
cc`.

D does a decent job too, however, last time I used it, there was 
more work involved (e.g. tranlating structs). importC seems to be 
more like Zig's approach.


[1] https://ziglang.org/documentation/0.9.1/#C
[2] https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html


More information about the Digitalmars-d mailing list