4 ms·
D is one of those language that while it's technically very good, it's small eco system makes me look over it. I'm quite conservative about what libraries I rel
by lacampbell 7y ago
D is one of those language that while it's technically very good, it's small eco system makes me look over it. I'm quite conservative about what libraries I rely on, and with these smaller languages 90% of the libraries you want are someones hobby.
The betterC scenario has intrigued me before though, it seemed like a win all around since you'd be using C libraries anyway. I'd love to hear others experiences and anecdotes with this.
- vaylian 7y ago> it's small eco system makes me look over it. You have relatively clean access to all C libraries. But I do not know if that is relevant enough in your area of work/play. And the standard library is also pretty nice. Sure, it's nowhere near Python's Batteries-Included package, but it can get you quite far.
- 0815test 7y ago> You have relatively clean access to all C libraries. I thought much of the point of D as a programming language would be its "relatively clean" access to external C++ libraries, which is not a feature many other languages share? (whereas it is of course quite common to have a foreign-function interface with C.)
- bachmeier 7y ago> its "relatively clean" access to external C++ libraries They're working on it, but there's a lot more work to do: https://dlang.org/spec/cpp_interface.html https://dlang.org/spec/cpp_interface.html There's a reason other languages don't have easy C++ interoperability. > it is of course quite common to have a foreign-function interface with C Yes, but it's not trivial for the most part to interface with C code. D is designed to make it easy - to the point that you can #include a C header file and you're good to go.
- flukus 7y agoIt 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)