Why do C++ programmers are not interested in D?
Ola Fosheim Grøstad
ola.fosheim.grostad at gmail.com
Tue Nov 19 14:36:06 UTC 2019
On Tuesday, 19 November 2019 at 13:06:29 UTC, Mark wrote:
> In addition to what others have written, here's another thing
> to consider: D's "killer feature" is its metaprogramming
> capabilities, but I don't think most C++ programmers, rightly
> or wrongly, care that much about metaprogramming.
I think library authors do, though. Anyway there are issues
related to meta programming in C++, D, and Rust. But they all
also improve on that for every significant version bump. Whoever
stops evolving their metaprogramming features will fall behind.
Rust is getting const generics eventually and C++ has added many
library features and some minor language tweaks. It would be a
good idea for D to make some statements about what is coming on
the metaprogramming front.
> I think the reason Rust hasn't replaced C++ (so far, anyway) is
> similar - it's killer feature is "memory safety by default" but
> most C++ programmers that I know don't consider (lack of)
> memory safety to be a major problem in the language.
There are certain things in rust that is verbose in Rust and that
would be annoying to many C++ programmers. E.g. if you don't want
to initialise a variable then you have to wrap the type in
MaybeUninit<T>, and then use mem::transmute<_,T>(variable) as a
cast after the variable has been initialized.
This level of safe/unsafe type system verbosity is only ok if you
almost always initialise variables.
I think the default mode for many C++ programmers is to not trust
the optimiser to get it right. Which can be a liability, it
really depends on whether you want a primarily low level language
with some high level capabilities (C++) or a primarily high level
language with some low level capabilities (D and Rust).
More information about the Digitalmars-d