2 ms·
IMO D is exactly that, "a better C++", and does not try to be anything more. Rust, on the other hand, is more of a "this is a tool that should address all your
by Manishearth 10y ago
IMO D is exactly that, "a better C++", and does not try to be anything more. Rust, on the other hand, is more of a "this is a tool that should address all your C++ needs" (which means it won't be better than C++ in all aspects), and it does try to be something more.
D seems to be designed to be a language that has the exact same powers (or better) as C++, but tidied up. C++ has over time grown to be a very powerful language but these powers are all bolt-on and don't interact well together. D is a language designed from the perspective of "Okay, we have all these C++ features being used in these ways, let's build a more holistically-designed language that has the same features, and correct all the mistakes along the way". I think it's good to have language refreshes like this. You get a chance to fix all the warts and make improvements without breaking backcompat. It's very useful alternative to C++ when you need something that behaves very much like C++. Plus, it has `extern (C++)`, which makes it super easy to incrementally drop in to C++ code.
Ultimately, Rust is pretty different. It doesn't have template metaprogramming. It doesn't have inheritance. While most of the problems solved by these tools can be solved in other ways in Rust, it doesn't change the fact that Rust introduces more paradigm shifts. Of course, safety is a benefit that pretty much overshadows this, but there is something to be said for languages like D which are "better C++"s without changing the paradigms involved.