News for hackers. Stuff that matters.
Re:C++20 has been approved by The_rationalist on Sunday September 06, 2020 @06:12AM (#24390303)
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

Re:C++20 has been approved by beagle3 on Sunday September 06, 2020 @06:34AM (#24390379)
> 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.

Re:C++20 has been approved by Matthias247 on Sunday September 06, 2020 @12:27PM (#24392454)
Right. 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.

Re:C++20 has been approved by pjmlp on Sunday September 06, 2020 @06:46AM (#24390440)
Indeed, but there is so much to do on the ecosystem.
Re:C++20 has been approved by the_mitsuhiko on Sunday September 06, 2020 @07:11AM (#24390548)
I 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.
Re:C++20 has been approved by jb1991 on Sunday September 06, 2020 @08:36AM (#24390927)
> 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!

Re:C++20 has been approved by tlamponi on Sunday September 06, 2020 @09:05AM (#24391045)
Not 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.

Re:C++20 has been approved by moldavi on Sunday September 06, 2020 @02:04PM (#24393294)
As 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.

Re:C++20 has been approved by pjmlp on Monday September 07, 2020 @03:24AM (#24397341)
Until Apple, Google, Microsoft, NVidia, Khronos, Sony, Nintendo, ARM have Rust on their SDKs alongside C++, their communities will keep focusing on C++ for high performance code.
Re:C++20 has been approved by the__alchemist on Sunday September 06, 2020 @12:18PM (#24392386)
Another 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`.
Re:C++20 has been approved by vanderZwan on Sunday September 06, 2020 @08:53AM (#24390998)
Maybe 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.
Re:C++20 has been approved by OnlyOneCannolo on Sunday September 06, 2020 @07:38AM (#24390686)
Rust'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.

Re:C++20 has been approved by edflsafoiewq on Sunday September 06, 2020 @06:18AM (#24390328)
Which features in particular?
Re:C++20 has been approved by The_rationalist on Sunday September 06, 2020 @06:26AM (#24390357)
The 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/p072...