5 ms·
Except for the memory model, rust is loosing a lot of it's competitive advantages over C++ here and more interestingly: C++ is pushing the frontier on what new
by The_rationalist 6y ago
Except for the memory model, rust is loosing a lot of it's competitive advantages over C++ here and more interestingly: C++ is pushing the frontier on what new features/optimizations should a high performance language get.
I feel like some of those features will allow new kind of optimizations and it could have an impact on the performance of everyday programs like chromium or Firefox. Of course the adoption will take a few years
I really hope that Rust compiler team will investigate in great depth the expert changes in C++20 and backport the relevant stuff into rust
- edflsafoiewq 6y agoWhich features in particular?
- The_rationalist 6y agoThe likely / unlikely attributes and the constexpr advances, regarding performance, for example. But many performance gains will be automatic e.g http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0722r3.html http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p072...
- beagle3 6y ago> Except for the memory model, rust is loosing a lot of it's competitive advantages over C++ here Rust's memory model is by far its most significant advantage over C++, and it cannot be added to C++ without breaking all backwards compatibility.
- pjmlp 6y agoIndeed, but there is so much to do on the ecosystem.
- Matthias247 6y agoRight. Rust is the only of those languages where I feel comfortable handing tasks out to junior programmers and NOT having to hunt for memory errors later in code reviews. That’s such a great reassurance and productivity gain for everyone that it seems hard to go back. In addition to that it also protects against the majority of multithreading issues - which is something not even available in managed languages like C# or Java.
- the_mitsuhiko 6y agoI don't think Rust is in any way losing anything by whatever is happening in the C++ world. With every iteration of the language it's biggest downside is becoming worse: it's a complex language very few people fully comprehend these days.
- jb1991 6y ago> it's a complex language very few people fully comprehend these days Well I see your point, the reality is that this statement is also true of rust itself!
- tlamponi 6y agoNot really, it even lost quite a bit o baggage when becoming 1.0. The features it gets now are all mostly on the roadmap since quite a bit and neither surprising nor do the feel like a huge pile of "everything I can imagine" thrown together. Rust is several order of magnitudes away become such clogged like C++ is, and also its feature acquisition accelerates slower than the one of C++. The only thing slower than that acceleration is probably its compile speed, but here C++ isn't really better. :) From observing both since a bit I just really got the feeling that rust adoption of things was more thought out to fit the existing language and ecosystem, not 100% perfect, but much more fitting than what C++ did, i.e., mixing in every thing they could get their hands on, while some actually made things better, a lot just do not go well when being together.
- moldavi 6y agoAs much as I enjoy Rust, I have to agree with GP. Rust team needed to add a lot of complexity to the language to allow us to solve the borrow checker puzzles, such as Pin, Cell/RefCell, split_at_mut, the list goes on, and keeps growing. In my modern C++ projects, I only really need to know std::move and std::unique_ptr. The real question to ask is how much complexity one's willing to pay for memory safety. I'm willing to pay it, but with open eyes about the complexity cost I'm paying.
- pjmlp 6y ago
- OnlyOneCannolo 6y agoRust's main competitive advantage is memory safety in a compiled language with native performance. If you're switching to C++ because of performance, you should have probably picked C++ instead from the beginning.
- vanderZwan 6y agoMaybe it's just me, but if a programming language successfully pushes other languages to catch up or even outdo them in terms of language design, then I would not call that "losing". In the long run we all benefit from that.
- the__alchemist 6y agoAnother thing not to be underestimated: C and C++'s build tools and dependency process can be intimidating for new users. Rust uses a configuration file to specify dependencies and compile options, then runs with `cargo run`. This is notable on embedded, where the process for Rust is similar as non-embedded, with the addition of installing a CLI app like `probe-run`, and adding a config file specifying memory available. On C and C++, vendor-specific IDEs (Like STM32 cube) are appealing to configure the build process... and the starting files created with these are complicated, even for `hello world`.