
Ask HN: Why isn't D more popular? - eranation
I just recently discovered dlang accidentally, after doing a graduate course that had assignment in c, while looking for better alternatives to system programming, I heard about Rust, but D seems to be a really nice alternative to C&#x2F;C++ as well. I was pretty impressed by the amount of libraries, package manager, IDE support and modern capabilities.<p>What would be a reason to not use D and prefer for example on Rust for system programming? Is D slower due to garbage collection?<p>Or in other words, why D didn&#x27;t &quot;replace&quot; C for system programming?
======
sparkie
A few possible reasons I can think of:

* The benefits it offers over C++ are (or were) not significant enough to make people invest in the switch

* There were issues in the past with a poor initial standard library (Phobos 1), which led to an alternative standard library, Tango being developed - which was incompatible with Phobos, and resulted in a somewhat divided ecosystem where you had to prematurely pick one or the other. Eventually these issues were ironed out and an improved Phobos became the standard library, with Tango made compatible with it. (The damage was already done though.)

* Library availability lacked compared with C++ - although D could import C standard libraries it was not ABI compatible with C++, and its target audience - C++ programmers, were not going to throw away backward compatibility with all of the libraries they had already written.

* As you suggest, the word "Garbage Collection" scares some people away, despite it being optional.

* It's not backed by a big name - and our industry is obsessed with big names.

* Perhaps a lack of literature and interest by academic institutions to teach it.

None of these are issues for present-day D, but I think people's perception of
the language is still affected by them.

------
xaa
It is indeed a really nice language. My biggest irritation with it was that it
can't parse C headers, so even though you save programming time vs C++ due to
its higher level of abstraction and flexibility, you lose a lot of that time
redeclaring C prototypes and/or fighting with SWIG.

Also, at the time I was using it, there were 3 main compiler implementations,
which were not entirely compatible with each other, and the dynamic linking
story was poor.

EDIT: Also at the time I was using it (about a year ago), the package manager
was very buggy and inflexible. It assumed that each package would output
exactly one library or one binary.

------
axaxs
D didn't have a big company behind it. I believe the main implementation is
also closed source, mainly the work of one guy initially, who happens to be
around on HN.

~~~
yen223
I thought D was backed by Facebook

~~~
loumf
D is publicly used by Facebook, but I don't think for production -- it's used
for their style-checker

[https://code.facebook.com/posts/729709347050548/under-the-
ho...](https://code.facebook.com/posts/729709347050548/under-the-hood-
building-and-open-sourcing-flint/)

------
auganov
I'm not sure how low level your thinking. But golang is somewhat notable here.
It's gaining a lot of traction in the cloud space mainly thanks to Docker. A
nice write up here: [http://redmonk.com/dberkholz/2014/03/18/go-the-emerging-
lang...](http://redmonk.com/dberkholz/2014/03/18/go-the-emerging-language-of-
cloud-infrastructure/)

It's probably not an alternative to C/C++ and perhaps what it's used for is
not systems programming in a strict way. But most software today is related to
the cloud in one way or another. And Golang is picking up traction here that
might otherwise have gone to these other languages you all mentioned.

------
pcwalton
Rust has memory safety without garbage collection; D requires garbage
collection for safety. That's the biggest difference, I think.

~~~
danford
>D requires garbage collection for safety.

Source? D has more users[1] and is more Robust than Rust and beats Rust on
many benchmarks[2]

[1][http://www.tiobe.com/index.php/content/paperinfo/tpci/index....](http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html)

[2][http://attractivechaos.github.io/plb/](http://attractivechaos.github.io/plb/)

[2A][http://benchmarksgame.alioth.debian.org/u64/which-
programs-a...](http://benchmarksgame.alioth.debian.org/u64/which-programs-are-
fastest.php) (D is not included in this benchmark, but judging by how it
compares to C++ and C, it most likely would beat Rust in the second category.

~~~
pcwalton
I didn't say anything about number of users or about benchmarks.

------
danford
While not related to Rust, I think you and a lot of commenters in this thread
might find this helpful:

[http://programmers.stackexchange.com/questions/97207/what-
do...](http://programmers.stackexchange.com/questions/97207/what-does-c-do-
better-than-d)

And this is from two years ago, so I would expect the language to have come
even farther since then.

------
SamReidHughes
I think the reason in the long run will be that it's a bad language. It has
stuff in the standard library like passing lambdas and strings as template
parameters. And the complexity it has is often the language trying to hack
around its own bad design.

~~~
danford
If you think D is bad you must think C++ is atrocious.

------
bryanjos
I really want to start playing around with D but my biggest concern is the
number of available libraries. That's not going to stop me from using it but
it is a concern of mine.

~~~
logic_error
You should check out the dub registry (at
[http://code.dlang.org/](http://code.dlang.org/)). I've found that pretty much
everything I've ever needed is there, and everything else can be found via a
quick google search.

