The forked elephant in the room

Walter Bright newshound2 at digitalmars.com
Mon Jan 29 06:21:00 UTC 2024


On 1/28/2024 8:11 PM, Lance Bachmeier wrote:
> On Sunday, 28 January 2024 at 05:29:54 UTC, Walter Bright wrote:
> 
>> It's fair to consider the result. ImportC elicited more or less no interest 
>> from anybody. I expected that. Over time, though, its detractors who have 
>> tried it have found it to be a game-changing time saver. ImportC is a huge win 
>> for D.
> 
> I wouldn't say "no interest". This is [what I 
> said](https://forum.dlang.org/post/apozoxpxalpdqiysoqak@forum.dlang.org):

Thanks for reminding me! My mind is like a sieve.


>> This will be incredible. I have a lot of use cases for it. In particular on 
>> Windows where linking to DLLs is not fun.
> 
> It turns out I was a bit too optimistic. The number of dependencies for the 
> typical C project is huge, including things like glib, so avoiding them isn't 
> usually possible. I also underestimated the widespread use of compiler 
> extensions (thankfully this doesn't seem to be much of a problem any longer for 
> ImportC).

I, too, underestimated the pervasive (and usually quite unnecessary) use of 
bizarro extensions in the C header files. The majority of the problems with 
ImportC were(are) these extensions.


> What has worked surprisingly well is converting C headers to D and then using 
> traits to create dynamic bindings at compile time. So while it is not what I 
> originally thought it would be, it's been a win for me in a different way.

You and Adam Wilson! An unanticipated use, for sure.


More information about the Digitalmars-d mailing list