4 ms·
> In a not-that-near future, C++ will die of ugliness I am so excited for that day. There are some really amazing upcoming languages positioning themselves to
by evincarofautumn 13y ago
> In a not-that-near future, C++ will die of ugliness
I am so excited for that day. There are some really amazing upcoming languages positioning themselves to replace C++ for new applications. Rust seems to be in the best spot right now; Nimrod is also pretty compelling.
- z3phyr 13y agoThat day might never come. Good things of rust will eventually make their way into newer C++ standards. The industry largely depends on C/C++, and switch to other languages is getting out of the comfort zone.
- glennsl 13y agoYou might get some of the good stuff, but you won't get its killer feature, robustness, without sacrificing backwards compatibility. And that's not going to happen. Eventually we have to move on to more robust programming languages where null pointers and pointers to freed memory are not allowed.
- wicknicks 13y agoI'm hoping for a not-that-far future ... Jokes apart, does Rust perform as well as C++?
- evincarofautumn 13y agoAnecdotally yes, within a few percent, depending on what you measure. Safe code tends not to perform as well as unsafe code, but this is also true in C++—most applications just tend to err (and I mean err) on the side of performance.
- sanxiyn 13y agoThe difference is that in Rust you can write unsafe implementation of safe interface. In C++ you cannot specify safe interface. (You can and should document memory management assumptions in C++, but C++ compiler does not enforce such documentations.)
- mden 13y agoOut of curiosity, in what ways is Rust that much less uglier than C++? I've only looked through the docs and the code provided and it seems to be riddled with the same type of "ugliness" inherent to C++ - namely the ugliness symbolized by the need for all of the special characters like * and &. It seems like Rust has some nice syntax for pattern matching, but what else?
- nnethercote 13y agoYou're only thinking about syntax. Look deeper.
- evincarofautumn 13y agoSyntax is undoubtedly important, but primarily as a means of elegantly expressing the unique semantics of a language. The visible ugliness is the language being explicit about low-level details. So what else? Rust isn’t a huge innovation in terms of language features, but it does take advantage of relatively recent advances in language design (e.g. typeclasses) and has an excellent combination of defaults. The important ones are memory safety, an ownership model (think unique_ptr/shared_ptr), immutability, and isolated lightweight threads.
- mercurial 13y agoWell, it also handles lifetimes, which is certainly a huge improvement in terms of safety, though it comes at, shall we say, syntactic cost: pub fn to_rigid_body_or_fail<'r>(&'r self) -> &'r RigidBody<N, LV, AV, M, II> {