4 ms·
Rewriting/porting the Linux kernel would be a massive undertaking, and guaranteed to introduce new bugs. Not something you would do without massive benefits. R
by geon 5y ago
Rewriting/porting the Linux kernel would be a massive undertaking, and guaranteed to introduce new bugs. Not something you would do without massive benefits.
Rust with its safety guarantees has those benefits in a way no other language does.
While Zig enables writing safe code, it does not enforce it. D and C++ mainly improves productivity.
- johnisgood 5y ago> Rust with its safety guarantees has those benefits in a way no other language does. Excuse me? Do you know about Ada/SPARK? Rust is super far from Ada in terms of safety. I see misconceptions about Ada here all the time. Well, either that, or they do not know much about the language. Seriously, if you are interested in safety, you must check Ada/SPARK out.
- brabel 5y agoI think you're right, but there's very little chance Ada/SPARK will ever become as popular as Rust because of politics. Rust managed, somehow, to get the backing of tech giants like Microsoft and Amazon... the fact it started at Mozilla, a well-regarded company with lots of influence in tech (despite its downwards trajectory in the browser wars) probably means more than any technical advantage Rust has over the competition (though I have to say Rust's type system and the borrow-checker are really inovative on their own and deserve the general praise they receive). If Ada/SPARK were to be successful, they would need this corporate backing. Maybe that's possible outside the USA? Say, the EU probably has enough influential tech companies and weight to push forward with a Rust competitor that's perhaps superior (as you claim, I don't know enough about SPARK yet to make that claim myself)? I think that would be extremely benefitial to both the tech world AND to Rust and Ada themselves... competition is a great way to make things evolve fast. EDIT: Ada/SPARK does seem to have a really good advantage over Rust: it's an actual specification, not just a single compiler implementation where "whatever the compiler does" is how the language behaves. This is very important in many industries. I know there's work ongoing to fix this for Rust, but that may take several years and even never amount to anything.
- thesuperbigfrog 5y agoAda 2012 Reference Manual: http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-TOC.html http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-TOC.htm...
- geon 5y agoThose are pretty obscure. Do you expect os developers to use them?
- asoneth 5y agoI am an outsider who has not personally written anything in Ada/SPARK or Rust. But I have worked at companies that transitioned (or started to transition) from C/C++ to Ada/SPARK and from C/C++ to Rust. I suspect that there are a few additional factors besides politics that prevented some C developers from taking Ada/SPARK as seriously as they seem to be taking Rust. 1) Ada and SPARK still retain a whiff of academic/military design-by-committee which prejudices a certain kind of developer. Whereas the Rust team has been open-source from the start. 2) The military projects I am familiar with started switching to Ada (and later SPARK) due to the US DoD mandate in the 90s. Of the people I know who use it, many of them started using it because their job required it. (Though to be honest many of them now love it!) Whereas Rust adoption seems to be largely driven by a hearts-and-minds initiative to convince regular developers that memory safety is a problem in C, and that they should choose Rust to solve that problem. 3) Syntax. Some C developers don't seem to consider a language a Serious Programming Language unless it uses curly braces. (Just ask a C/C++ developer about Lisp's parentheses or Python's whitespace.) Whereas the Rust team decided to hew close to the conventions used in C wherever appropriate.
- johnisgood 5y agoI have to say that I love curly braces, but given some Ada's features I can forgive the language for the lack of it. :) But yeah, those points are fair.
- IAmLiterallyAB 5y agoDoes Ada also have something similar to the borrow checker? That is, forbidding bad memory access at compile time. I'm not familiar with Ada
- johnisgood 5y agoYou may want to read https://news.ycombinator.com/item?id=28999859 https://news.ycombinator.com/item?id=28999859.
- laumars 5y ago> Rust with its safety guarantees has those benefits in a way no other language does. Lol no. There’s plenty of languages that are equal to or even more safe than Rust. Many of which are also more mature than Rust too. This meme of “Only Rust provides safety” really needs to die.
- geon 5y agoI apologize if I was unclear. Obviously other languages have type safety. But a language like Haskell is not very suitable for writing a kernel. I believe Rust is the language that has the right feature set and momentum to even have any hope of being taken seriously for such a task.
- laumars 5y agoRust isn’t even the only mature systems language that offers memory safety. In this thread people have thrown Haskell and Perl as examples of languages not suitable for writing a kernel and while they’re right it’s still a straw man argument because they’re exampling languages that nobody is advocating for kernel development.