6 ms·
You've dismissed his question without really answering it, which is a little unfair. The OP's question might be unpopular on HN (who largely seem to be in love
by hnlmorg 5y ago
You've dismissed his question without really answering it, which is a little unfair.
The OP's question might be unpopular on HN (who largely seem to be in love with Rust) but it's a valid question and not one that's at odds with Rust either.
To paraphrase his question: "Why is there more momentum behind Rust to replace C than there has been before?"
> So does perl, there's more to the debate than if a language has some "benefit".
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".
Zig, D and Ada might all be perfectly valid languages to rewrite Linux in. So might OCaml and countless others. But it is Rust that has the momentum. As someone who can program in > dozen different languages, I too have found the momentum behind Rust a little unusual and I can't really put my finger on why it has proven so popular when others have, relatively speaking, failed. There are aspects of Rust that I like but I don't find it an order of magnitude better than Ada, OCaml nor Zig.
So the question remains open, what has changed that all of a sudden the time is right to rewrite Linux?
I wonder if a large part of Rust's success isn't down to the language per se but rather down to it emerging just as C++ was finally reaching that critical mass point where developers are fed up with it's complexity and ready to jump ship. With the other languages either peaking too early or simply lacking enough corporate sponsorship for the mainstream to adopt. Maybe the syntax has a part to play too where Rust looks more familiar to new C/C++ developers in a way that Ada and OCaml do not.
- tcmart14 5y agoMaybe to try to answer some of OP's question. Rust is past it's "1.0" release. Other alternatives are also plenty viable and I would love to see more technical conversation considering them, but I think Rust is viewed as more mature (not a 'Rust' user here). An example, I find Zig really interesting. However, I think even the main creator of Zig says it is not production ready yet (however it is getting closer to that '1.0' release). D may be the only one I know (besides Ada) that has that level of maturity.
- bawolff 5y agoAlso, for people who hate memory safety issues, does it really matter which language? Rust is a solution with momentum. For the people motivated by that concern, fighting over language choice is a distraction.
- hnlmorg 5y agoFor user land it doesn't matter at all as people can mix and match whatever languages they want as long as there is an ELF entry point into the runtime. However rewriting the kernel, which is what this discussion is about, is a whole other matter.
- moltonel3x 5y agoUserland is worth fighting for too. https://imgs.xkcd.com/comics/authorization.png https://imgs.xkcd.com/comics/authorization.png But as bawolff said, the main issue is moving towards safer tech. If Ada had good enough momentum, we'd be discussing Ada in the kernel instead. C++ has been rejected from Linux, leaving Rust as the only kernel-capable language with enough momentum, so Rust it is.
- hnlmorg 5y ago> Userland is worth fighting for too. https://imgs.xkcd.com/comics/authorization.png https://imgs.xkcd.com/comics/authorization.png That has nothing to do with memory safety though let alone Rust specifically. What we need is a smarter way to manage authentication (non-persistent session cookies and usage a password manager to handle the log in is a step in the right direction).
- tcmart14 5y agoNot necessarily. Language does matter as it is a construct that forms how problems are thought about. One thing I like about D is how it is much more multi-paradigm. I would like to see some more analysis of using D in Linux.
- 5y ago
- chronial 5y agoI don't know Zig, Ada and D very well, but isn't Rust the only language that can guarantee huge amounts of safety with zero runtime overhead due to the burrow checker? I think that is its differenciating property.
- rightbyte 5y ago> zero runtime overhead due to the burrow checker You have to structure the program in a way to make it happy, though. Which is not zero runtime overhead compared to a wild west program.
- pjmlp 5y agoNope, Rust still cannot provide formal proofs Ada/SPARK style, and using String, Vec, Rc, Arc, RefCell imposes just runtime checks as other type safe systems languages.
- johnisgood 5y agoNo, you can guarantee much more with regarding to safety using Ada/SPARK. I have a table somewhere. So if you want safety guarantees, it is Ada/SPARK all the way. Check out https://blog.adacore.com https://blog.adacore.com. I cannot emphasize it enough: if people really wanted so much safety, they would have chosen Ada/SPARK. I also find Ada easier to read and write than Rust. I know C, OCaml, Erlang, Forth, and Factor, yet I have difficulties with Rust. Am I really that bad of a programmer? Welp, at least I know Ada and I can write actually super safe stuff. :P
- lionkor 5y ago"I think Ada/SPARK needs to seriously be considered for a lot more projects. Maybe we need better tooling, but still".unwrap().unwrap().unwrap()
- johnisgood 5y agoIt has a package manager now! :D Anyways, there are some things that could make Ada/SPARK more desirable but it has nothing to do with the language itself. :(
- bawolff 5y ago> 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"
- hnlmorg 5y agoWhile 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.
- bawolff 5y agoWell 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.
- junon 5y ago> but rather down to it emerging just as C++ was finally reaching that critical mass point where developers are fed up with it's complexity and ready to jump ship. I think you're on to something here.