Remix.run Logo
Iridescent_ 6 hours ago

Rust has editions for strong stability guarantees, and has had them for nearly a decade i believe. Besides, tech backing has grown way past the risky point.

umanwizard 6 hours ago | parent [-]

FWIW, the GP comment's claim that you're lucky if you can compile 2-year-old code is exaggerated, but so is yours. Rust does not offer "strong stability guarantees". Adding a new method to a standard type or trait can break method inference, and the Rust standard library does that all the time.

In C or C++, this isn't supposed to happen: a conformant implementation claiming to support e.g. C++17 would use ifdefs to gate off new C++20 library functions when compiling in C++17 mode.

throwaway27448 6 hours ago | parent | next [-]

> and the Rust standard library does that all the time.

I don't doubt this is true, but do you have an example? I think I haven't run into a build breaking like this in std in like maybe seven/eight years. In my experience breaking changes/experimental apis are typically ensconced in features or gated by editions.

Granted, it'd be nice to be able to enforce abi stability at the crate level, but managing that is its own can of worms.

I did find that the breakage rfc allows for breaking inference, which tbh seems quite reasonable... inference is opt-in.

umanwizard 5 hours ago | parent [-]

Almost every major release of rust stabilizes new library methods. For example, the latest major release (1.93) stabilized Vec::into_raw_parts. This isn’t gated by an edition. So if you had a trait with a method “into_raw_parts” which you had defined on Vec, after updating to 1.93 or later your code will either fail to compile, or start running different code when that method is called.

Sorry, I meant to write “method resolution”, not inference. This isn’t the same issue as type inference (though indeed, stdlib changes can break that too)

ChadNauseam 6 hours ago | parent | prev [-]

Adding a new method can change the behavior of C++ code as well due to templates. Does the standard library never add new methods because of that?

jjmarr 6 hours ago | parent | next [-]

Yes. All the time. Subscribe to the std-proposals mailing list and you'll see so many obvious improvements get rejected due to ABI compat guarantees.

umanwizard 5 hours ago | parent | prev [-]

> Adding a new method can change the behavior of C++ code as well due to templates.

Yes, but the code can be gated off with ifdefs to only be present when compiling for a particular version of the standard.