News for hackers. Stuff that matters.
Re:Writing a Linux-compatible kernel in Rust by bawolff on Tuesday October 26, 2021 @06:32AM (#28998596)
> It's pretty clear that Perl isn't a systems language nor performant enough to write a kernel even if it were a systems language. So bringing that up is rather silly. And you don't even answer the question of "what is more to the debate than "some benefit".

But that's exactly my point. The OP asks, why not a language "better" than C, full stop. That's the wrong question. There are many languages better than C according to someone, but terrible to write a kernel in. Better than C is a terrible metric. The momentum behind rust isn't because it is simply better than c in some unspecified way.

To actually answer your question, i think its both political and technical. Rust is on an upswing. In any political movement,momentum is important. Ada is old news, it doesn't have that excitement around it that is critical for a political movement to galvanize its supporters. From a technical perspective, it seems like support primary comes from people who hate memory safety vulns. That's the impetus but lots of languages prevent that. The aspects of c that make it popular are (syntactic) simplicity and full control. Rust has really good PR to suggest that it does the memory thing very well, well still valuing the other factors that make c popular. Other languages tend to try and improve a lot of things or stray further from the c path, which make it seem like bigger switch with higher costs.

So in conclusion, i think rust does just enough to have a benefit people consider "worth it" (relative to switching costs) well not straying too far from c values which makes switching costs low. It also came at the right time, has momentum and good propaganda, which is critical for any political "movement"

Re:Writing a Linux-compatible kernel in Rust by hnlmorg on Tuesday October 26, 2021 @07:23AM (#28998954)
While I have no issue with people picking languages for personal reasons, if we are going to start presenting RIIR (Rewrite it in Rust) as a technical argument then we need to move past the "it has momentum" part of the argument because trends have a habit of changing (as you've acknowledged yourself).

Not taking anything away from this specific project though as it's a hobby project. Just making a wider point about the calls for deprecating C and C++ in GNU/Linux.

Re:Writing a Linux-compatible kernel in Rust by bawolff on Tuesday October 26, 2021 @12:03PM (#29002097)
Well i did say that's a political reason not technical, and the question was why is RIIR a thing, not list some technical reasons why rust is great.
Re:Writing a Linux-compatible kernel in Rust by hnlmorg on Wednesday October 27, 2021 @06:05AM (#29011263)
Fair enough. I just worry that this momentum is a little premature and we'll end up creating as many problems as we solve. Rust is still quite a young language and while it has already proven itself it has also already taken on a lot of complexity despite its age and gone through several iterations of breaking changes too. I'm not entirely convinced that in 10 years time Rust wont end up as painful to audit as C++ is now. While Rust does offer some memory safety guarantees out of the box, that still depends upon the abstractions not needing to fallback to `unsafe` -- which isn't going to be avoidable with kernel development. And as the complexity of the code base and language semantics grow, the developers ability to audit `unsafe` is going to be will diminish in competency. And that's without even addressing the risk of introducing new bugs as part of the rewrite. Taking those points into account, I can't help feeling there's a little bit of "the emperors new clothes" going on here were the promises being made are greater than the reality.

I'm all in favour of a "rewrite it in $SAFE" but the risk adverse part of me feels like Rust is a combination of too young and lacking in formal guarantees to consider the massive undertaking we're asking here. Particularly when you consider this is going to be a multi-decade project and one that we can't trivially switch to another language if we regret that decision part way. To give context to that point: it's already been 30 years of C with Linux, longer if you count BSD or Unix. So the commitment we're asking from Rust is massive.

Maybe I'm being overly cautious. Unfortunately I've found the discussions on the topic are usually underwhelming in terms of people being prepared to honestly answer the hard questions about Rust's readiness for such a critical role. And that has left me feeling more nervous than reassured that the whole thing isn't just a fad.