4 ms·
Almost the entire language since its early days. And there have been 2 major editions in the last 5 years.
by jfkebwjsbx 7y ago
Almost the entire language since its early days. And there have been 2 major editions in the last 5 years.
- bschwindHN 7y agoI would only count language changes since its 1.0 release, there really haven't been that many.
- jfkebwjsbx 7y agoThat's fair, then 1 major edition. There have been a lot of added features, though. I am not sure why people downvoted me.
- kibwen 7y agoIn the parlance of the Rust developers, a "feature" is often just the addition of a single function to the standard library. The only remotely paradigm-shifting feature to be added since 1.0 was async/await; the other things mentioned in the blog post are minor QOL nice-to-haves.
- gamegoblin 7y agoI don't think it's really fair to talk about pre-1.0 language changes -- by definition, being pre-1.0 typically implies a lack of stability. One of the major editions you mention is the 1.0 release. So, there has been 1 new edition since 1.0, and, as the parent comment says, the only really groundbreaking change since 1.0 is the stabilization of async support. Other changes, such as the `dyn` keyword and match ergonomics are mostly superficial, and things such as NLL and additional lifetime elisions are just simple quality of life improvements that don't fundamentally change the language.
- geofft 7y agoNot only is it unfair, it's counterproductive - the lesson future languages will learn is to not work in public and to not improve. Rust pre-1.0 was a mess and nobody would have been better off if it had gotten frozen with all the not-so-great stuff officially supported.
- iknowstuff 7y agoYou mean pre-1.0. There has been one major edition afterwards, Rust 2018, which is optional but has awesome new features like non-lexical lifetimes, async/await keywords and I guess `dyn`.
- ekidd 7y agoI've been writing Rust since before 1.0, and I maintain at least once piece of 5-year-old production Rust code. In general, old Rust code continues to work almost completely unchanged. There have been 3 or 4 cases where I couldn't compile an ancient dependency because it was relying on something weird like a soundness bug. The fix was usually to update the dependency to the latest minor revision. Rust 2018 fixed a few minor syntactic issues, adding the "crate" keyword for imports from the current crate, and "dyn" in front of dynamically dispatched traits. These can both be updated using 'cargo fix' in about 20 minutes. Rust 2018 modules can use Rust 2015 modules almost completely seemlessly, even when macros are involved. Is it perfect? No. But updating older code is something I spend a day or two a year on.
- jfkebwjsbx 7y agoThat is fine, but note that 2 days a year is about 1% of work time, and that time increases as the code size increases. Moreover, in some companies you cannot simply update external dependencies without extra painful reviews.
- kccqzy 7y agoIf by "its early days" you want to talk about pre-1.0 Rust, then I think a fair comparison is pre-C++98 C++, from the original Cfront. At that time C++ was just C with classes. It didn't have templates, namespaces, and plenty of other indispensable features in modern C++.
- artursapek 7y agoBryan Cantrill's talk about Rust addresses when they removed green threads, and how much of a bold, disruptive change that was. He remarks on how that impressed him with the Rust community and made him follow the language more closely - had they been too scared to change the language in drastic ways, we would still be stuck with green threads. Sorry, I can't remember the timestamp right now but the entire thing is worth a listen: https://www.youtube.com/watch?v=LjFM8vw3pbU https://www.youtube.com/watch?v=LjFM8vw3pbU
- steveklabnik 7y agoAnd to be clear, this was before 1.0; we cannot do this kind of thing these days.