4 ms·
* The kernel doesn't need all those new bells and whistles that Rust wants to offer in the future, at least not as fast as how they are being shipped. * The ke
by esjeon 4y ago
* The kernel doesn't need all those new bells and whistles that Rust wants to offer in the future, at least not as fast as how they are being shipped.
* The kernel requires stability. Building a kernel w/ rustc is like building a house on a flying bullet.
* GCC is insanely good at porting to other architectures, something vendors have been relying on for a long long time.
* Consistency in applying compile flags and optimizations.
Idk, these are all I can think of right now.
- nindalf 4y ago> least not as fast as how they are being shipped. Could you give some examples of big features from the last 12 months? I can’t think of any big ones off hand. IIRC, just a large number of small improvements. > The kernel requires stability. I can’t recall a new Rust release ever breaking existing code. Is this what you’re talking about? > GCC Rust will have a GCC backend and/or frontend soon. > Consistency in applying compile flags and optimizations. Can’t say much about this but I’m fairly sure the kernel devs won’t let anything be merged until they’re satisfied. We can trust them on this.
- estebank 4y ago> I can’t recall a new Rust release ever breaking existing code. Is this what you’re talking about? I have one case of code from late 2015 that stopped working in, IIRC, 2016, due to unsoundness being found in the borrow checker and it being fixed. error[E0713]: borrow may still be in use when destructor runs --> src/writer.rs:121:21 | 47 | impl<'a, F: Write + Read + Seek + 'a> Writer<'a, F> { | -- lifetime `'a` defined here ... 121 | Reader::new(self.file) | ------------^^^^^^^^^- returning this value requires that `*self.file` is borrowed for `'a` 122 | } | - here, drop of `self` needs exclusive access to `*self.file`, because the type `Writer<'_, F>` implements the `Drop` trait I ended up solving it by wrapping `self.file` in an "unnecessary" `Option` and using `Option::take` on `self.file` here. I guess I could have mucked around with `MaybeUninit` and risk UB instead, or removed the convenience `Drop` impl finalizer or made the impl non-generic. I haven't had a case of code no longer compiling since then.
- esjeon 4y agoYou're not doing engineering here, bro. > Could you give some examples of big features from the last 12 months? > ... > I can’t recall a new Rust release ever breaking existing code. Is this what you’re talking about? Let me show you two links: 1. Rust version history: https://github.com/rust-lang/rust/blob/master/RELEASES.md https://github.com/rust-lang/rust/blob/master/RELEASES.md 2. GCC changes: https://gcc.gnu.org/gcc-12/changes.html#c-family https://gcc.gnu.org/gcc-12/changes.html#c-family Compared to Rust, GCC, the C compiler, is absolutely boring. The C language has been stable for decades, so there's hardly anything to be done on the language itself. GCC has been used in all kinds of occasions, and has compiled all types of applications and system software. We know it works in every situation. There's hardly anything to be done. This is how the real stability looks like - boring as shit. Now, what, 12 months? The number isn't simply getting there.
- zamalek 4y ago> The kernel doesn't need all those new bells and whistles that Rust wants to offer That's a bewildering statement considering that one of the bells and whistles that Rust offers is memory safety.
- esjeon 4y agoI mean the ones in the unstable branch. Stable Rust is just good enough, as it can perfectly reproduce the C-like coding experience with added type safety.