But why
But why
Posted Oct 2, 2024 10:49 UTC (Wed) by tialaramex (subscriber, #21167)In reply to: But why by sam_c
Parent article: An update on gccrs development
To me that suggests that you've extrapolated wildly rather than actually having "a lot" of these cases.
Posted Oct 2, 2024 17:53 UTC (Wed)
by sam_c (subscriber, #139836)
[Link] (6 responses)
I already gave evidence that it wasn't faulty at all -- it happened in May for Firefox. We had an issue with rustls' build.rs needing nightly in March (they were happy to fix it though). For a long time, 'eww' (not the Emacs one) required nightly but they fixed that in Feb. Chromium requires nightly features (at least for various -Z ... flags it passed) at the moment. Those are examples I've hit personally and that I can easily recall, and I don't represent all developers in our distro.
Posted Oct 2, 2024 17:54 UTC (Wed)
by sam_c (subscriber, #139836)
[Link]
(My point being that others mention such cases as well, I just don't remember the package names without checking logs.)
Posted Oct 3, 2024 8:33 UTC (Thu)
by tialaramex (subscriber, #21167)
[Link] (4 responses)
How confident are you that every single C and C++ program that's packaged has all the correct feature tests for the features it depends on? Both languages do notionally provide these tests. I've never used them. My guess is that actually very few even try and that the feature tests which are present in the rest are often faulty, so long as the code builds and seems superficially to work on popular platforms that's enough.
Posted Oct 4, 2024 3:28 UTC (Fri)
by sam_c (subscriber, #139836)
[Link] (3 responses)
I didn't even say "it's not mature", I said it indicates to me that it isn't yet - very much about my perception and open to discussion, which is why I'm commenting at all...
> How confident are you that every single C and C++ program that's packaged has all the correct feature tests for the features it depends on?
I spent a lot of time on this sort of thing last year, which LWN wrote about. Not very confident at all! But my point was and remains that if Rust is mature, I'd expect use in the kernel to not need heaps of nightly features. It comes across as odd to me because if Rust is deployed widely in kernel-like environments, surely this kind of functionality should be worked out already?
Posted Oct 4, 2024 13:03 UTC (Fri)
by tialaramex (subscriber, #21167)
[Link]
That would depend what "this kind of functionality means". For example Linux really can't abide floating point, so for them it's crucial that you can't by any means end up doing floating point operations in Rust for Linux unless you've spelled out that intent very clearly. Unsurprisingly in most applications it's enough that (as is true in stable Rust) you don't stumble onto floating point operations when you never needed them. For example in Rust, just as in C, 5 / 2 is 2 because it's not performing a floating point divide and then transmuting the type as it would in say, Python.
So to adjust from "Yeah, so don't do that" to "We'll make sure you won't do that" Rust for Linux needed tweaks and the stable Rust does not have those tweaks.
Are you astonished that nobody else had this requirement? Nobody in embedded cares, most of the other operating systems are not in a place where "enforce micro-optimisation of context switch overhead" is a focus. If there are people who care (maybe at Microsoft?), and are using Rust for the OS kernel, they're not advertising this use.
In 2023 you could point at alloc, back then Rust for Linux relied on a fork of alloc because Linus requires that allocations are fallible at the point of use, which means all the Rust APIs which panic on allocation failure must be removed from Rust for Linux. Rust's core does not allocate - it doesn't have an allocator so it can't, and Rust's std layer requires an operating system so it will never be part of Rust for Linux - we're implementing the OS not using it. But alloc was in the middle, and so for a period Rust for Linux forked it. That's done, the stable Rust ships all the explicit allocation failure stuff which Linus insists on.
But actually in alloc we do see things where (I did not check specifics) Rust for Linux might want them but they aren't in stable Rust today. Vec::push_within_capacity for example. In C you'd just use it and YOLO. In Rust that will not work† and you must ask for nightly Rust if you want these features.
† You could use Mara's nighty_crimes! macro or write your own, but that's not a serious suggestion and in practice amounts to the same thing.
Posted Oct 6, 2024 22:55 UTC (Sun)
by raven667 (subscriber, #5198)
[Link] (1 responses)
I think this whole effort _is_ the process by which the specific changes needed for Rust to support the existing Linux kernel (rather than a custom all-Rust kernel or userspace application) become mature, Rust is clearly capable of it, the clock for stability _starts_ when the implementation of Rust is ready, but it's only marked as "stable" after some time of real-world use. A half-thought-through analogy is that some special vintage wine is the same liquid put in the bottle the day it was made, when it wasn't special, but time and some tiny changes made it special later, a feature might land in nightly but with time and some tiny changes it becomes stable infrastructure, but it was substantially there the day it was made in nightly. Rust for Linux is going to take several more years to all come together and be seen as old-and-stable, but that is the trend.
Posted Oct 7, 2024 14:13 UTC (Mon)
by raven667 (subscriber, #5198)
[Link]
You can describe several milestones of maturity, Rust as a mature standalone application development language, Rust maturity for mixed C/C++ applications and library development, Rust maturity building a standalone kernel, Rust used in some generic mixed C/C++ kernels and Rust for Linux the specifically fits in with the internal style and abstractions of Linux. People can end up talking past one another a bit by not being clear as to what they are referring to.
But why
But why
But why
But why
But why
But why
But why