Just wait
Just wait
Posted Jun 22, 2024 12:08 UTC (Sat) by willy (subscriber, #9762)In reply to: Just wait by wsy
Parent article: Rust for filesystems
"Science advances one funeral at a time"
I'm disappointed by how resistant some fellow hackers are to Rust. It's the first language in 50 years to be enough of an advantage over C to be worth switching to.
Posted Jun 22, 2024 12:37 UTC (Sat)
by liw (subscriber, #6379)
[Link] (12 responses)
Posted Jun 23, 2024 8:52 UTC (Sun)
by Wol (subscriber, #4433)
[Link] (3 responses)
It usually involves changing your entire way of thinking.
Look at that post a few days back over P4 - where the comment was "someone comes along thinking they can rewrite it in C", and several man-years of effort later, they realise that actually, someone using a domain specific language can do double the work in half the time, if not even better.
Going back even further, someone commented people who've learnt Rust usually make far better C programmers because, even though C doesn't enforce memory safety etc, because Rust insists that you code in memory-safe ways, they code memory-safe in C anyways.
It's like me and databases - 4th normal form is the best for a whole bunch of reasons, but because my experience is with a database where 4th normal form was the OBVIOUS way to do it, when I'm forced to work with relational I do it without thinking. Unfortunately I'm usually working with stuff designed by others where I'm thinking "what the hell were they thinking?".
Cheers,
Posted Jun 23, 2024 17:48 UTC (Sun)
by Kaligule (subscriber, #167650)
[Link] (2 responses)
Posted Jun 23, 2024 19:37 UTC (Sun)
by softball (subscriber, #160655)
[Link]
Posted Jun 24, 2024 22:04 UTC (Mon)
by riking (subscriber, #95706)
[Link]
Posted Jun 25, 2024 13:36 UTC (Tue)
by zuki (subscriber, #41808)
[Link] (7 responses)
There's also the distinction that there are different levels of "knowing" a language. It's quite easy to get to the level where one can do small modifications to existing code, or to copy existing functionality and extend it to cover additional cases. It's much harder to know which of the many possible ways of structuring code and which abstractions to use for a new problem. But fortunately, for ongoing maintenance, this first easier level is all that is needed. The second higher level is only necessary e.g. to implement or review new Rust abstractions in the kernel or new drivers, but a different set of people can handle that.
I think it's entirely reasonable to ask maintainers to also care about the Rust code.
Posted Jun 25, 2024 14:36 UTC (Tue)
by pizza (subscriber, #46)
[Link]
I agree in principle -- but we're a long, long way from the "ongoing maintenance" phase.
The current status quo is that, in order to meaningfully contribute to kernel-Rust, you have to essentially be an expert in all-things-Rust, including living on the bleeding edge of Rust language/feature development.
> I find the attitude of "I don't care about Rust, I'll not learn Rust" annoying and destructive.
You may find it annoying but it is an entirely rational (and reasonable!) attitude to take given that hyper-unstable nature of kernel-Rust and the already-overwhelming "just maintaining existing stuff" workload.
After all, "Let those who care about X do the work" has been the kernel development philosophy since approximately forever.
Posted Jun 25, 2024 14:51 UTC (Tue)
by somlo (subscriber, #92421)
[Link]
However, unlike Go, I find Rust hard to skim over -- for the lack of a better word, it's too "syntax-y" for my brain :) So your "anyone should be able to deal with it" statement is actually a much bigger ask than you think, depending on the actual language's legibility to newcomers.
I then tried working my way through "The Rust Programming Language", and was mostly able to follow along and understand what's going on, and even managed to write ok-ish small programs in the process.
But without being a real, $DAYJOB Rust programmer, when I look at production code a few months later, it's back to a wall-of-syntax "foo::bar => <blah:::xyz>" incomprehensible gibberish... :D
I'm also constantly high-key annoyed at how compiling a program involves downloading crap off the Internet, as part of the compilation process (this is the part where I might just be old and grumpy, and the whole download-crap-from-the-Internet thing is interfering with my lawn care routine).
Anyhow, if kernel maintainers' experience is anything like mine, I can't blame them for putting a "low pass filter" on this thing: maybe it goes away if they ignore it long enough, and they won't have to waste time on it.
Now, if based on the description of my pain points above there's a more targeted way of learning Rust in a way that sticks, I'm happy to take hints and advice...
Posted Jun 25, 2024 15:40 UTC (Tue)
by farnz (subscriber, #17727)
[Link]
The other thing to bear in mind is that different languages have different challenge levels when you're not very good at them. At one extreme, you have languages where just about everything you could reasonably consider "language source code" is accepted by implementations as "valid" code, and if you barely understand the language, it's really hard to avoid making mistakes.
At the other extreme, you have languages where the compiler will definitely complain if you make a change that won't work, and thus it's a lot easier to avoid making mistakes because the compiler tells you that what you've implemented is not going to work.
And in the middle of those two extremes, we have real languages, where some things that won't work cause the compiler to complain (such as including a file that doesn't exist like #include <linus/asm.h>), while other things that won't work compile and fail later.
The interesting question is whether Rust is strict enough that someone with good C skills and minimal Rust skills can be confident that the Rust toolchain will complain if they make the "obvious" fix, but it's wrong, or whether they have to learn more Rust so that they can do the checks themselves (or ask someone else to check their work).
Posted Jul 4, 2024 2:23 UTC (Thu)
by mrugiero (guest, #153040)
[Link]
I'm not sure if I'm inventing this, but I believe the deal was that maintainers got to decide whether Rust made it into in their subsystems? If that's the case, it's only reasonable to expect them to either reject the patches or commit to keep them working. Otherwise we're in a kind of Seinfeld's car reservation situation.
Posted Jul 17, 2024 12:19 UTC (Wed)
by that_kca (guest, #172467)
[Link] (2 responses)
I mean is it any more annoying or destructive than the "Everything must be written in rust" evangelism that many of the rust fans parrot?
I imagine if rust spent less of the design/engineering points in being hard to learn the language might find more people willing to pick it up.
But then the majority of the rust internet community would probably run to something else.
Posted Jul 17, 2024 13:40 UTC (Wed)
by Wol (subscriber, #4433)
[Link] (1 responses)
Rust FANS, or Rust PROGRAMMERS.
Generally you'll find the people who make the most noise, are the people who do the least work. That's not always a bad thing, you need your evangelists (after all, I make a heck of a lot of noise about Pick/MV), but there are too many people who think it's a silver bullet when they've never really used it.
It DOES sound great. And given that all the evidence says it's not vulnerable to a huge class of errors that regularly bite C/C++, there's good reason to - as a minimum - try it out. But it's noticeable that a lot of people are too busy using it to evangelise it. That to me is a good sign.
Cheers,
Posted Jul 17, 2024 16:55 UTC (Wed)
by andresfreund (subscriber, #69562)
[Link]
Posted Jun 22, 2024 14:05 UTC (Sat)
by khim (subscriber, #9252)
[Link] (1 responses)
Sure, but the flip side is that it is the first language in 50 years that offers genuine advantage large enough to switch. The only way to convince people to switch is to write more good Rust code, ultimately.
Posted Jun 22, 2024 14:21 UTC (Sat)
by adobriyan (subscriber, #30858)
[Link]
Just imagine what bug-for-bug compatible Linux.rs kernel could do...
Just wait
Just wait
Wol
Just wait
Just wait
P4
Just wait
Just wait
Just wait
This may be just an undiagnosed learning disability on my part, or it might be that Rust syntax is simply less legible to a large swath of the otherwise OK programmer population.
Changing code when you barely understand the language
Just wait
Just wait
Just wait
Wol
Just wait
> It's the first language in 50 years to be enough of an advantage over C to be worth switching to.
Just wait
Just wait