Why is D unpopular?

H. S. Teoh hsteoh at quickfur.ath.cx
Fri May 13 18:36:11 UTC 2022


On Fri, May 13, 2022 at 06:22:08PM +0000, Adam D Ruppe via Digitalmars-d wrote:
> On Friday, 13 May 2022 at 18:17:06 UTC, Walter Bright wrote:
> > htod, dstep and dpp suggest otherwise.
> 
> What shortcomings did you see in those, and how does ImportC solve
> them?

I think somebody has mentioned: all of these require an extra build
step.

Personally, I don't think it's a big deal, but then again I use a real
build system as opposed to crippled walled gardens (*ahem* *cough* not
naming names here), so hey.  In any case, if you could just `import
"freetype/freetype.h";` and have it Just Work(tm) without further ado,
that would make C integration even more accessible than ever, esp to
people with a phobia of using/modifying a real build system.


> > They're good tools, but don't quite get us there.
> 
> In what way? How does ImportC get where they don't?

Assuming that ImportC overcomes its current limitations, the difference
is:

htod/dstep/dpp:
- Edit dub.json / makefile / whatever
- Create rule to run htod/dstep/dpp on library.h to create a library.di
  or library.d.
- Don't forget to add `-L-llibrary` to linker flags.
- `import library;'.

ImportC (assuming limitations are fixed):
- `import library;`.

It's a matter of removing the speedbumps on the road so that there's
less friction to interfacing with C.


T

-- 
Your inconsistency is the only consistent thing about you! -- KD


More information about the Digitalmars-d mailing list