5 ms·
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?
- axaxs 13y agoD 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.
- eranation 13y agoSeems to be open source now: https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd
- yen223 13y agoI thought D was backed by Facebook
- indolering 13y agoD has been around for 15 years.
- loumf 12y agoD 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-hood-building-and-open-sourcing-flint/ https://code.facebook.com/posts/729709347050548/under-the-ho...
- sparkie 13y agoA 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 13y agoIt 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.
- pcwalton 13y agoRust has memory safety without garbage collection; D requires garbage collection for safety. That's the biggest difference, I think.
- danford 13y ago>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.html http://www.tiobe.com/index.php/content/paperinfo/tpci/index.... [2]http://attractivechaos.github.io/plb/ http://attractivechaos.github.io/plb/ [2A]http://benchmarksgame.alioth.debian.org/u64/which-programs-are-fastest.php 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.
- pcwalton 13y agoI didn't say anything about number of users or about benchmarks.
- bryanjos 13y agoI 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 13y agoYou 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.
- marv36 13y agoPlay around with the D... in the library? shame on you!
- SamReidHughes 13y agoI 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 13y agoIf you think D is bad you must think C++ is atrocious.
- auganov 13y agoI'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-language-of-cloud-infrastructure/ 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.
- danford 13y agoWhile 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-does-c-do-better-than-d 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.