3 ms·
> D, Rust, OCaml, and a few other projects are interesting in this space since they provide some of the same benefits as C++ with respect to correctness and saf
by pcwalton 9y ago
> D, Rust, OCaml, and a few other projects are interesting in this space since they provide some of the same benefits as C++ with respect to correctness and safety.
Can you name a correctness and safety benefit that C++ has that these programming languages do not?
- red75prime 9y agoProbably there are no such benefits. But taking the less serious approach, LLVM's -fsanitize=undefined could be thought of as the one.
- humanrebar 9y agoI didn't mean to imply that C++ was safer somehow. I just meant that those languages are also competing in that feature space in a way that C doesn't. And, on a pedantic level, C++ competitors can't provide exactly the same benefits of C++ because they took different approaches. What's a key design difference among these languages? Well, C++ can mostly just #include a C header file and go with it. The other languages provide FFI mechanisms, but they each require declarations of the FFI to match the compiled C code. So theoretically there's a little more room for errors in that translation, though I doubt that's a big concern on the whole. Each of those languages have more mature module systems, which should more than make up for keeping FFI interfaces in sync with C headers.