5 ms·
> Why, if C is so bad, wasnt one of the alternatives introduced to slowly replace C in the kernel years ago? Couldn't you always say this up until the time it
by bawolff 5y ago
> Why, if C is so bad, wasnt one of the alternatives introduced to slowly replace C in the kernel years ago?
Couldn't you always say this up until the time it happens? There always has to be a first success.
E.g. pre unix you could ask, if high level languages are so great, why weren't they used instead of assembly a long time ago.
> Zig, D, Ada, ... they all offer massive benefits over C.
So does perl, there's more to the debate than if a language has some "benefit". Its all about costs and benefits. I think the way rust has positioned itself makes it a bit more palatable than those other languages in this domain. That doesn't neccesarily mean it will succeed, but it seems more in the right direction for that goal than some of its competitors.
- hnlmorg 5y agoYou'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).