Why is D unpopular?

H. S. Teoh hsteoh at quickfur.ath.cx
Mon May 16 14:21:30 UTC 2022


On Sun, May 15, 2022 at 11:41:06PM +0000, forkit via Digitalmars-d wrote:
[...]
> No. My argument is not that ImportC is wrong, or even useless.
> 
> My argument has to be taken *in context* of wanting programmers to
> write safer, more secure code, and how ImportC does not advance that
> aim, and *possibly* does the exact opposite.
> 
> So, by raising my concern, I hope to get people to think twice before
> importing C code into their D projects, with the aim of not even
> needing to know what that C code does.

IMO this is misguided.  Without ImportC, it takes more effort to use a C
library.  Which incentivizes would-be project authors to just write more
C to interface with the library, rather than put in the effort to leap
through the hoops just so you can write D.  The net result is more
unsafe C code is written.

With ImportC (fully implemented -- though we're not quite there yet),
it's easy to call an existing C library from D, so there's less
resistance to writing D code to interface with it. The net result is
*less* C code is written, more D code is written.

And I'm sure you'll agree that more D code and less C code == more
safety and security, than the other way round.


T

-- 
Being forced to write comments actually improves code, because it is easier to fix a crock than to explain it. -- G. Steele 


More information about the Digitalmars-d mailing list