Why is D unpopular?

H. S. Teoh hsteoh at quickfur.ath.cx
Thu May 12 00:53:07 UTC 2022


On Wed, May 11, 2022 at 05:10:00PM -0700, Walter Bright via Digitalmars-d wrote:
> On 5/9/2022 9:16 PM, Joshua wrote:
> > Lately I started looking at compiled functional languages that
> > integrate easily with C because I expect I’ll need their
> > expressiveness and type safety for some tricky data transformations.
>
> With ImportC, D is getting pretty darned good at integrating with C.

Even without ImportC, I already integrate with C well enough.  I've been
converting C prototypes to extern(C) declarations on an as-needed basis
(as opposed to translating the entire C header), and it works pretty
well.  Thanks to pragma(lib), I don't even need to change my build
script; the compiler automatically pulls in the library for me upon
importing the converted D module.

The main hurdle of ImportC that makes it not as attractive as it could
be, is the lack of an integrated C preprocessor. Meaning, I have to
manually invoke the C preprocessor before ImportC is useful. That pretty
much nullifies the value of ImportC: I might as well just translate the
C prototypes myself and it'd be less troublesome.  If ImportC were to
reach the point where I can literally just import any system C header,
*without* needing to run the preprocessor myself beforehand, *that*
would make ImportC immensely more useful in terms of C integration.


T

-- 
If you want to solve a problem, you need to address its root cause, not just its symptoms. Otherwise it's like treating cancer with Tylenol...


More information about the Digitalmars-d mailing list