3 ms·
I've been hearing good things about the D community, but I've yet to see what makes it a better choice than Rust or Go. Anyone care to enlighten me?
by zeckalpha 13y ago
I've been hearing good things about the D community, but I've yet to see what makes it a better choice than Rust or Go. Anyone care to enlighten me?
- ben0x539 13y agoIt's more of an attempt to provide a better C++, whereas I'd frame Rust or Go as attempts to avoid the need for a C++. D might be for you if you're heavily into C++ template metaprogramming and wish it was neater and more expressive and all around more powerful.
- pjmlp 13y agoI would classify both D and Rust as modern languages for systems programming, for those developers that care about expressive languages with meta-programming capabilities and modern type systems. Go is rather what Java 1.0 should have been, 20 years later.
- puppetmaster3 13y agoThis!
- bjz_ 13y ago> modern type systems I would dispute the fact that the type system is the a big draw to D. Whilst it is an improvement on C++, it is still hampered by the fact that it is ultimately descended from the ALGOL lineage. Advanced type systems lie with the MLs and Haskell, languages that Rust's type system is inspired by. What D has over Rust however is its expressive template metaprogramming. Templates have their shortcomings, but they are still a powerful form of static code generation that can really empower library developers.
- pjmlp 13y agoSure, I wasn't putting one against the other, as I like both languages and feel both will appeal to different types of audiences anyway. My main point was that they follow the school that you need expressive type systems, even if as you noted, each has different strengths. And both, each with a different set of mechanisms, allow for some sort of compile meta-programming.
- sanderjd 13y agoIn addition to some of the other good answers here, D is a good deal older than Rust and is, I believe, more stable and mature as a result. If you're looking for a production-ready C++ alternative now, rather than X months from now, it seems like D is probably a better choice than Rust.
- zeckalpha 13y agoThat is a good point, though D2 is younger than Rust, no?
- sanderjd 13y agoFair point. Sounds like you probably know a lot more than me. Is D2 enough of an overhaul that I'm wrong about their relative stability and maturity?
- zeckalpha 13y agoI know nothing, just what I've heard/read. If you go off age alone, 2006 vs 2001 isn't too far off.
- eco 13y agoNo, D2 was first released in 2007. It wasn't a completely new language written from scratch though. It was D1 with the addition of features that broke backward compatibility.
- qznc 13y agoCompared to Go: D is not focused on writing servers, but a more general language with much more features. Templates, Meta Programming, etc makes it more complex and harder to learn. However, it also gives you a comprehensive toolbox for any programming task you encounter. Compared to Rust, D is rock solid stable, relatively. Ok, seriously. Rust seems to specialize on low-level or high-performance code. D also allows for high-level easy programming (aka Java) due to its simpler type system, garbage collector. However, D does not sacrifice performance. I think Rust will find its niche more as a C replacement than a C++ replacement.