News for hackers. Stuff that matters.

Ask HN: Why isn't D more popular?

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/C++ as well. I was pretty impressed by the amount of libraries, package manager, IDE support and modern capabilities.

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?

Or in other words, why D didn't "replace" C for system programming?

( 17 comments | 27 points | on HN )
Re:Ask HN: Why isn't D more popular? by sparkie on Saturday May 03, 2014 @05:58PM (#7692480)
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.

Re:Ask HN: Why isn't D more popular? by xaa on Saturday May 03, 2014 @06:08PM (#7692503)
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.

Re:Ask HN: Why isn't D more popular? by axaxs on Saturday May 03, 2014 @05:50PM (#7692464)
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.
Re:Ask HN: Why isn't D more popular? by eranation on Saturday May 03, 2014 @06:22PM (#7692548)
Re:Ask HN: Why isn't D more popular? by yen223 on Sunday May 04, 2014 @04:40AM (#7693725)
I thought D was backed by Facebook
Re:Ask HN: Why isn't D more popular? by loumf on Wednesday May 07, 2014 @10:47AM (#7710426)
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...

Re:Ask HN: Why isn't D more popular? by indolering on Sunday May 04, 2014 @05:04AM (#7693752)
D has been around for 15 years.
Re:Ask HN: Why isn't D more popular? by auganov on Sunday May 04, 2014 @06:22AM (#7693835)
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...

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.

Re:Ask HN: Why isn't D more popular? by pcwalton on Saturday May 03, 2014 @08:48PM (#7692891)
Rust has memory safety without garbage collection; D requires garbage collection for safety. That's the biggest difference, I think.
Re:Ask HN: Why isn't D more popular? by danford on Sunday May 04, 2014 @09:22PM (#7696570)
>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....

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

[2A]http://benchmarksgame.alioth.debian.org/u64/which-programs-a... (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.

Re:Ask HN: Why isn't D more popular? by pcwalton on Monday May 05, 2014 @07:05PM (#7701859)
I didn't say anything about number of users or about benchmarks.
Re:Ask HN: Why isn't D more popular? by danford on Sunday May 04, 2014 @09:25PM (#7696576)
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...

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

Re:Ask HN: Why isn't D more popular? by SamReidHughes on Sunday May 04, 2014 @05:57AM (#7693801)
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.
Re:Ask HN: Why isn't D more popular? by danford on Sunday May 04, 2014 @09:17PM (#7696562)
If you think D is bad you must think C++ is atrocious.
Re:Ask HN: Why isn't D more popular? by bryanjos on Saturday May 03, 2014 @09:21PM (#7692985)
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.
Re:Ask HN: Why isn't D more popular? by logic_error on Saturday May 03, 2014 @09:23PM (#7692992)
You should check out the dub registry (at 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.
Re:Ask HN: Why isn't D more popular? by marv36 on Sunday May 04, 2014 @12:38AM (#7693283)
Play around with the D... in the library? shame on you!