4 ms·
If that's your goal I think you should wait a few years before starting using Rust. We have already seen early Rust code not compiling with new compiler release
by zibzab 5y ago
If that's your goal I think you should wait a few years before starting using Rust. We have already seen early Rust code not compiling with new compiler releases. Right now we are in a move fast and break things phase.
Also, you need to be careful about what you implement yourself and what you import from crates. Otherwise it will be qt5 all over again.
- CodesInChaos 5y ago> We have already seen early Rust code not compiling with new compiler releases. Are you talking about breaking changes in the compiler after Rust 1.0? That should be very rare, and generally easy to fix (e.g. by adding a few type annotations). Or did you use unstable features? (Not sure if embedded is usable without unstable nowadays)
- eldruin 5y agoIt depends on your target architecture. For example, embedded development on ARM with stable Rust has been possible since 2018 (Rust 1.31)
- Lorkki 5y ago> We have already seen early Rust code not compiling with new compiler releases. I haven't really seen that happen with post-1.0 Rust, which is everything onwards of early 2015. I believe they've since tightened a couple of edge cases due to soundness issues, but nothing worse than that. Would be interesting to hear about your contrary experiences.
- capitol_ 5y agoIt happened in the lexical-core crate somewhere in 1.5X. Here is a bug report I got about it with compiler errors listed: https://github.com/cortex/ripasso/issues/219 https://github.com/cortex/ripasso/issues/219
- eldruin 5y agoThis issue is on nightly Rust, not stable. A stable Rust compiler update should never break code. See: https://doc.rust-lang.org/book/appendix-07-nightly-rust.html https://doc.rust-lang.org/book/appendix-07-nightly-rust.html
- zibzab 5y agoA lot of embedded stuff needs nightly. Or at least, it was like this a year or two ago. A related issue is that for many companies "stable" means the version shipped with Ubuntu LTS.
- couchand 5y agoDepends on the architecture: ARM for instance is a tier 1 target and you can use stable.
- steveklabnik 5y agoThis is true for aarch64, but if you're not doing an embedded-linux style project, it's very likely you'll need nightly for inline assembly, though a significant chunk of that is being stabilized as we speak (though sadly not yet enough for my work...)
- couchand 5y agoGood point. Though you can always link to .S for that last bit, right? I don't mean to tell you your business, I know you folks are doing much more intense stuff than I am. It doesn't surprise me that you'd know exactly what's keeping you from using stable.
- steveklabnik 5y agoIt's all good, you're not wrong! It would just add a lot of complexity to the build for not a ton of gain...
- zibzab 5y agoIIRC last time we had issues it was something in the core libraries, not the compiler. I think it was something as fundamental as Error being changed or moved around.
- eldruin 5y agoYou may have started getting deprecation warnings because some methods in the `Error` trait have been deprecated [1] in favor of a different mechanism. Then, you may have configured warnings to result in compilation errors in your build/project, however, I would argue this situation is not what most people would understand as "code not compiling due to a compiler update". [1]: https://doc.rust-lang.org/std/error/trait.Error.html https://doc.rust-lang.org/std/error/trait.Error.html
- zibzab 5y agoIn my case it failed to build, maybe it was a different problem, maybe the compiler had at some point emitted errors instead of warnings. I don't remember and it doesn't really matter other than we had build issues and it was unexpected.
- steveklabnik 5y agoDeprecation should be the only change to Error in the last six years. It hasn’t moved. If you ever get a repro would love to hear about it! This kind of thing doesn’t happen at the scale we’re at anymore, if it did there would be an uproar.