9 ms·
How often does Rust change?
- einpoklum 7y agoAnswer: 1. Quite often. 2. With some breakage of existing programs. ... and this is a fundamental paradigm difference between Rust and C++, for which the answers are: 1. Every 3 years. 2. Changes are backwards-compatible [1] ----- [1] There are slight specific manageable caveats. Example: The repurposing of the `auto` keyword.
- steveklabnik 7y agoMy personal take is that 2 is the same across both languages. C++ has actually made some more aggressive removals than Rust ever has. Note that none of this analysis analyzes breaking-ness of changes, so I’m not sure how you got this from the post.
- namibj 7y agoStable Rust has never broken a crate. If you specify a different edition for your own crate, you can still use dependencies of both older and newer versions. C++ won't let you just (seamlessly) use a C++98 library in a C++20 project, or vice-versa.
- steveklabnik 7y ago> Stable Rust has never broken a crate. This is too strong. We have made some soundness fixes that have broken crates. (We spread the change out with warnings for a long time before actually breaking) We have changed type inference in ways that one or two crates needed to add an annotation. The vast majority of the time this is correct though.
- pcwalton 7y agoThis is unfair. If you're going to qualify C++'s breaking changes as "slight specific manageable caveats", then you need to do the same for Rust. "Rust changes are backwards-compatible with slight specific manageable caveats" is a perfectly reasonable description of Rust's language changes.
- chungy 7y agoFor those that assert Rust changes too much, I would submit the simple question "Why?" to them. "Too much" seems to imply that the language breaks their code too often to make it worthwhile writing software, though this has been a thing Rust explicitly avoids since 1.0 happened. Rust 2018 took some liberties at breaking old code, but it only really matters if you explicitly upgrade to 2018, at which point you've already committed yourself to making potentially-significant changes. I imagine a future "big change" like Rust 2021 or whatever would do the same; I likewise hope that all N editions can interoperate no matter how many N editions exist. > However, maybe there’s a better way to surface “these are big changes” vs “this is a small thing,” or something like that. I’m not sure. It might be as hard, or even harder, to quantify this than even deciding what gets put into the release notes. What might be a big change for one person is absolutely insignificant for another, and vice-versa.
- steveklabnik 7y agoEvery edition will interoperate the same as 2015 and 2018 do, this is a hard constraint of editions. We technically have not yet decided if there will be a Rust 2021. I think there should be, but it should be smaller than 2018.
- chungy 7y ago> this is a hard constraint of editions. That's pretty awesome! Should I assume this only applies if a "Rust 2.0" never happens, or is there a commitment to 2.0 never being a thing?
- bluejekyll 7y agoAt this point, what would a 2.0 be exactly? I guess dropping 2015 as a supported source edition?
- steveklabnik 7y agoWe have said there won't be a Rust 2.0. If course, in theory we could change our minds. Can't imagine a current scenario where it makes sense, though.
- rattray 7y agoSubject matter aside, it's always wonderful to see thought leaders analyze their prior public claims and reach a conclusion that their hypothesis was wrong. Hats off.
- BiteCode_dev 7y agoI hear exactly the same about Python. Some complains it's moving too fast. Some that's it's an old language that's stuck in the past. The balance between stability and keeping up with modernity is hard to reach, and people will never be happy.
- BurningFrog 7y agoYou have a point. But also remember that happy people are silent. No one goes on a Twitter rant about THINGS ARE PRETTY OK!!! There are plenty of happy Python people.
- mplanchard 7y agoComparison with python actually helps to put Rust in a positive light. Compared to the Python 2/3 debacle, Rust managed to introduce a major new version with lots of new language features (edition) while making it: a) entirely opt-in, b) easy to update to with automated tooling, and c) compatible with previous versions. Compare this to Python 3, which cannot load Python 2 libraries, cannot be converted automatically, and is now effectively required with the sunsetting of Python 2 in January of this year. Python has a lot of strengths, and I think 3 is way better than 2, but the transition was very painful. Meanwhile, I have a crate I wrote a while back for 2015 nightly, and it took me less than an hour to get it up and running for 2018 stable. But I didn’t have to! Everyone using 2018 (nightly) could still use the crate even if I hadn’t converted it.
- znpy 7y agoMeh. When considering a language for a project one should also consider its maturity. Stuff like C/C++ basically won't ever change*. Code that you write today will probably compile in ten years. If you're writing in C++17, there will probably be a C++17-mode in 2030, as there are C-99 and C-89 modes today. Otherwise, if you want the newest shiny language, you shouldn't complain when it changes. But it's nothing new really: there's no free lunch.
- bluejekyll 7y agoRust has made, and so far kept, this same promise. But also you’re wrong about C/C++, new versions of those compilers often uncover dormant undefined behavior when the compiler slightly changes behavior in certain areas.
- adev_ 7y agoThat's two different things. If your program does not compile anymore because it was relying on undefined behaviour, it was wrong from the beginning and deserved it. It is completely different of old sane codebase not compiling anymore due to syntactic sugar change in the language.
- bluejekyll 7y agoThose are not completely different things. I know it’s only 5 years, and while I know it has occurred, I personally have never had a breakage in my Rust codebases due to undefined behavior. That is a stronger guarantee being made by Rust than C or C++ have made.
- dralley 7y ago>> It is completely different of old sane codebase not compiling anymore due to syntactic sugar change in the language. That is not very common with Rust. If you just download some project off of Github (or using some dependency) from 2015, it is very very likely to "just work" even with a new compiler, due to how editions work. A more likely way to encounter issues is by pasting some code from Stackoverflow into a Rust project that is using a different edition. Yes, that can happen, but it's not anywhere close to as big of a problem.
- jeffrallen 7y agoA more relevant experiment would be to take Rust code released 6, 12, 18 and 24 months ago, and try to use it, in particular try to read messages in forums and stack overflow and try to use/fix that code. You'd find it was impossible, because Rust changes so fast that nothing written about it survives 6 months without becoming inaccurate. Which is why I threw up my hands and gave up.
- ethelward 7y agoYou have examples for that?
- bluejekyll 7y agoI’ve been working with Rust for over five years now. This does not relate to my experience. New things come and they make things easier, but anything from 6-24 months ago, still works in the identical fashion as it did at that point.
- Ar-Curunir 7y agoCitations please. I've picked up projects from 2 years ago, and barring soundness bugs, I've never encountered issues.
- wffurr 7y agoIt seems weird to think that Rust is changing too much. It's a young language and has a lot of catching up to do to cover all the use cases it's intended for and bring in all the niceties we expect out of modern multi-paradigm programming languages: procedural, functional, and object-oriented techniques. C++ is from 1985 and standardized in 1998, and it's still changing at a fast clip: C++11, C++17, Concepts will be a big deal when they happen in C++2?. Rust wasn't announced until 2010 and didn't ship 1.0 until 2015. It's only had 5 years to bake since 1.0, vs the 22 for C++.
- kccqzy 7y agoConcepts already happened. In C++20 released earlier this year.
- masklinn 7y ago> C++ is from 1985 and standardized in 1998, and it's still changing at a fast clip: C++11, C++17, Concepts will be a big deal when they happen in C++2?. C++ pretty much didn't change between 1998 and 2011 though (2003 was mostly a bugfix and compatibility release). And these days it updates every 3 years (you forgot C++14 though it was a very minor release) which is a much slower pace than Rust's 6 weeks cycle.
- wffurr 7y agoMajor C++ releases and Rust Editions are both on three year cycles.
- masklinn 7y agoAFAIK rust editions are not on any schedule currently, there's no guarantee that there'll be a Rust 2021 edition.
- steveklabnik 7y agoYes. We have not technically committed to a Rust 2021 yet. We are going to decide this year.
- ComputerGuru 7y agoI’m happy with the changes to rust and their pacing but I want to point out that merely asserting “you don’t have to use these features if you don’t want to” is disingenuous and particularly so for open source contributors (Steve did NOT say this but it was a common refrain in the discussion that Steve is contributing to). It threw me for a loop the first time that I saw the spread operator in an assignment in a project I was filing a PR for, and I thought I was on top of all the features. Some changes that stand out to me: the try macro being deprecated was huge, and though the ? Operator is a thousand times nicer, that was a rather radical shift to the ecosystem where you could smell code from yesterday a mile way; I seem to remember try blocks were stabilized then removed but I seem to be mistaken on that count; async of course is a huge change and it absolutely does force you to use it since it’s a contagious language feature in pretty much all languages (I’m very disappointed with tokio on this count and have a feature I’ll probably file a PR for to help reduce this); the change allowing reusing the same variable name inside a match binding as the variable being assigned to was hugely beneficial but quickly broke backwards compatibility because of how nice it was to give up. I think the changes to std::error are also worth mentioning, they might be backwards compatible but they completely obviated an entire generation of crates and coding styles (I for one do not lament the death of quick error and co). I feel a better metric for this might be to study the min rustc version to compile libraries, i.e. community adoption of new or breaking changes. If you take the releases from the top 250 crates in the past few years and see how many rustc versions back from whatever was stable at the time of release could compiled the release, that might give you a more data-oriented result. Also, I think some of the real frustration might be from “core” crate breakage, such as the transition from tokio 0.1 to 0.3 and the ensuing mess or examples like gfx-rs that hundreds of other popular crates built on to get OpenGL support before they completely deprecated it and pivoted altogether such that not all are those crates left based on a dead-ended project but OpenGL users are all SOL (“just a little while longer!”) as the community-adopted alternative is wgpu which requires Vulcan/Metal/DirectX until the promised OpenGL support lands there. I’m not complaining; NIH people generally get off easy with community deprecation of popular crates ;) and OSS developers are absolutely not beholden to anyone. But I imagine for developers plugged into the ecosystem, changes to extremely popular crates and changes to the language or standard library might result in a general annoyance that doesn’t distinguish between the two (and that’s also fair since the reason rust has a small standard library is so people use crates which can be more easily replaced or deprecated).
- as-j 7y agoThis is amazing, and great. "Does a language change too much" is very much use dependent, and it's great to have the data. For me, an embedded systems developer, this is an order of magnitude too much. Rust is so appealing for my use case in many ways, but I need an environment that a team can easily work in for years. My current code base is 10 years old. Our base system dates from 2017, and it took until 2018 for us to update to that. We were going to do a late 2019 base update, but sadly the project was delayed for other reasons. Our application side updates monthly, a much smaller OTA DFU. (over the air device firmware update) You can compare it Lua: https://www.lua.org/versions.html https://www.lua.org/versions.html The community is much smaller but it's interesting to see even at it's comparatively glacial release schedule there's a large split between 5.1/5.3. Why do a rapidly evolving language, stdlib, etc matter? 1. We're going to be year(s) behind. I need everyone to learn and be proficient at the languages we use. They need good consistent doc and manual for our version. And not complain that we're on 1.31.0 but this great feature is in 1.33.1. 2. Moving base languages is support, not direct project improvement. While we standstill moving the base system/language/tooling forward our customer releases a new feature. 3. People are always going to google "how to do silly thing" and get code snippets. Heck I do this all the time with Python. =) It's really nice for this be somewhat consistent/right. Sigh, as an embedded dev I'm so torn on Rust.
- steveklabnik 7y agoHave you heard of the Sealed Rust work?
- as-j 7y agoNope? This? https://ferrous-systems.com/blog/2019-06-05-sealed-rust-the-pitch.html https://ferrous-systems.com/blog/2019-06-05-sealed-rust-the-... Do you have a short version recap in 1 or 2 sentences? Plus any liensing/costs/etc/etc?
- steveklabnik 7y agoYep! The short recap is: some folks are trying to get a subset of the language certified. They run an entire consultancy that does a lot of embedded Rust work. I am hoping that this will help to alleviate the issues you're talking about; we'll see how it goes!
- infogulch 7y agoSomething that Steve touched on but didn't dive into is that there's a difference between measuring facts, like the number of changes in a period of time, and measuring the cognitive impact of those changes. I'm sorry in advance for how rambly this post is. `const fn` is a nice example, because it's a large number, but the cognitive impact could be neatly summarized for the general rust userbase by "neat, but I don't really care". The cognitive impact is directly proportional to how easily we can abstract the changes into a coherent story. Does it matter that there were exactly 138 "this fn is now const" changes in 1.33? No, because you already forgot that there were actually only 125. What's the actual difference between 13 extra `const fn` changes and a list of 13 other completely independent changes? 13 arbitrary library changes sound like a lot when they're not neatly bounded by a pre-existing frame of reference. In this case, "this fn is now const" * X where X is 'a big number' doesn't change in cognitive impact when X is replaced with X * 1.1. I think that Kubernetes release notes are another interesting example. There's typically a huge number of changes due to the distributed nature of the project's development. The vast vast majority of the changes would have little to no effect on your k8s deployment, but there may be some nugget in there that does have a big impact on you. The problem is that that nugget is different for everyone. So it seems like the key to communicating change may be to present the change in conjunction with a carefully selected frame of reference that enables the audience to easily conceptualize the bounds of the effects of the change in relation to their own experience, before being inundated with the details of the change that would only be useful to people occupying a different frame of reference. The problem is that everyone's experience is different and the impact a change will have will greatly depend on who's reading. Maybe release posts need old school newspaper-like front pages where changes are scoped and summarized, and details are hidden unless the user wants more. Or maybe there should be multiple posts from the perspective of different user personas. But these ideas aren't cheap to implement, and the problem seems to approach something like "the fundamental difficulty of communication" which is way beyond my scope of understanding.
- Rusky 7y ago> The cognitive impact is directly proportional to how easily we can abstract the changes into a coherent story. Exactly! This is how language and API changes are usually designed, and announcing them the same way is a great idea.
- tayo42 7y agoSome thoughts on my short experience with rust for anyone that cares. Probably a yearish ago?(Futures weren't solid yet) I didn't read the original blog post, just the head line and skimmed comments. Though i read this one I think this post alludes to my issue, the language it self i don't think changes at an unreasonable rate, the ecosystem felt like a problem. There's so much changing, what's the "right" way, the right library, expected syntax seemed overwhelming. maybe this doesn't change a lot, but it is compounded by the new user experience. Other things are out dated resources around the internet. The other thing I think that makes this seem worse is I think the a lot of the community is online and hobbyist work, and the speed communities change on line is just fast, information moves fast, blink and you'll miss something. I do remember feeling excited about rust, but it felt like there was always something new learn, something around the corner, something better coming then a new feature would come out, i gotta learn that, what is going on in nightly. Supposedly editions fixed that, but even that I gotta go figure out what an edition is and what its implications are. I haven't gone back to rust, at this point I feel like i need to relearn it to write anything worthwhile. Just basic stuff like how projects are laid out. I have a commit in the rust compiler, but i cant tell you the right way to organize a new project because at some point it changed. To much to keep in my head.
- iknowstuff 7y agoYou are absolutely right, futures were infamous for having a lot of churn and being really difficult to work with. Rust was very speedy but unergonomic for web stuff. This is why the past year was spent on async/await which dramatically changed it all and now writing web servers is really simple: https://github.com/seanmonstar/warp https://github.com/seanmonstar/warp
- ldng 7y agoNobody is "in the thick" as Rust core dev or aficionados are. There is a reason commercially backed language have a mush slower release pace and big release. It is easier to write doc for and prepare formations, classes and certifications For better or worse, in corporate/industrial landscape those are kings. If Rust does not understand that it might stay in the hobbyist category. With Javascript being the exception. Unless I am completely wrong and it is the new norm.
- ethelward 7y ago> With Javascript being the exception And Python. And Ruby. And C++. And Kotlin. And Swift.
- uluyol 7y ago> ... but soundness fixes happened so little it wasn’t worth talking about. There were 7 in those 42 releases. Are there any similar statistics for other languages? To me this seems high. It's not common that a program that compiles in other languages becomes illegal in a later release. I mean I understand why the Rust developers make this choice—the language aims to provide strong static guarantees, but I hope they appreciate that users don't like when their programs break after a compiler upgrade.
- steveklabnik 7y agoSome of them didn't break any more, they were always broken. Or, some of them were purely additive. We added mitigations against https://blog.qualys.com/securitylabs/2017/06/19/the-stack-clash https://blog.qualys.com/securitylabs/2017/06/19/the-stack-cl..., that was categorized as one.