News for hackers. Stuff that matters.
Re:Sayonara, C++, and Hello to Rust by usrnm on Tuesday December 07, 2021 @01:47AM (#29469679)
If JavaScript frameworks taught us anything, it's that people tend to fall for "new and shiny" much more willingly, than for anything related to quality.
Re:Sayonara, C++, and Hello to Rust by ioseph on Tuesday December 07, 2021 @02:01AM (#29469763)
I'm not too sure that's still the case in the javascript world. React is coming on to 10 years and still remains the most beloved framework.
Re:Sayonara, C++, and Hello to Rust by jayflux on Tuesday December 07, 2021 @03:33AM (#29470253)
That’s not really what was happening in the JavaScript world though.

It was a new ecosystem trying to figure itself out, and it takes quite a few attempts to do that. Both react and vue are near 10 years old, express is over 10 years, so it’s not “new and shiny” chasing.

Rust will go through the same thing before the dust settles.

Re:Sayonara, C++, and Hello to Rust by rapsey on Tuesday December 07, 2021 @02:07AM (#29469787)
Rust is not that new and shiny anymore.
Re:Sayonara, C++, and Hello to Rust by nindalf on Tuesday December 07, 2021 @02:24AM (#29469876)
Maybe that’s why they named it Rust. It sounds old and boring.
Re:Sayonara, C++, and Hello to Rust by FridgeSeal on Tuesday December 07, 2021 @03:27AM (#29470220)
For a bit of trivia, I believe it’s named after a fungus.
Re:Sayonara, C++, and Hello to Rust by nlitened on Tuesday December 07, 2021 @02:13AM (#29469812)
It has a new edition every year though :)
Re:Sayonara, C++, and Hello to Rust by rapsey on Tuesday December 07, 2021 @02:16AM (#29469829)
No it does not. 2015, 2018, 2021. With the 2021 changes so small few projects actually required any changes to be compatible from 2018.
Re:Sayonara, C++, and Hello to Rust by nindalf on Tuesday December 07, 2021 @02:35AM (#29469933)
The 2021 changes could be applied with an autofix tool - “cargo fix --edition”.

Most of these changes are small paper cuts that make sense to fix, but they’re breaking changes so they need to be opted into explicitly.

For example, earlier use a field x of struct b in a closure would capture the ownership of the whole of b. In rust 2021, the closure will only take ownership of b.x. This makes sense, but it’s a breaking change and therefore it needs an opt-in.

The Edition system is one of Rust’s biggest strengths IMO. Some languages never make breaking changes be enough if they’re small because it would break too much code. Other languages make breaking changes but expect users to migrate, placing a burden on them. The Rust edition system leaves it up to the user, on a per-crate (package) basis. Staying on the old edition is perfectly acceptable, as is moving to the new one.

Further reading - https://doc.rust-lang.org/edition-guide/rust-2021/

Re:Sayonara, C++, and Hello to Rust by GolDDranks on Tuesday December 07, 2021 @02:17AM (#29469831)
*every three years, actually. The current one is 2021, the one before that was 2018 and the (implicit) first one 2015.
Re:Sayonara, C++, and Hello to Rust by MaxBarraclough on Tuesday December 07, 2021 @02:28AM (#29469897)
I think that's at least somewhat particular to the web, though.

Plenty of 'C++ people' have been doing C++ for decades.