3 ms·
It looks like you still have to write interfaces for c libraries (https://dlang.org/spec/interfaceToC.html https://dlang.org/spec/interfaceToC.html) and that it
by flukus 7y ago
It looks like you still have to write interfaces for c libraries (https://dlang.org/spec/interfaceToC.html https://dlang.org/spec/interfaceToC.html) and that it can't use header files directly like zig. This is fine for interop but it's not great as a drop in replacement, there is still some manual work and likely many edge cases around macros in the c libraries.
I'm yet to put zig through it's paces but you can include header files directly, theoretically that makes it a much better drop in replacement.
- nicwilson 7y agoYou can write interfaces and for many projects that works fine. There are tools like https://github.com/jacob-carlborg/dstep https://github.com/jacob-carlborg/dstep to convert headers and tools like https://github.com/atilaneves/dpp https://github.com/atilaneves/dpp to "preprocess" the D source to include and translate headers
- mhh__ 7y agoYou could write that as a library feature in D, technically (I'm guessing no one's done it, for obvious reasons)