5 ms·
I'm pumped too see the new OS architectures Rust will allow for.
by adamnemecek 9y ago
I'm pumped too see the new OS architectures Rust will allow for.
- dmitrygr 9y agoSame as C. Rust is basically C with hardcoded checks enforced and put in by compiler that good programmers already know to put in.
- saghm 9y agoGiven all the vulnerabilities that have happened with C code over the years, I think making it harder for programmers to screw up is a win.
- woodrowbarlow 9y agowhile it's true that Rust has the potential to decrease the frequency and impact of certain types of bugs, i think the GP was saying that Rust's borrow checker is unlikely to revolutionize the way operating systems are designed and the way userspace interacts with the kernel. the GP fails to acknowledge Rust's other features such as its type system, but i'm not convinced those will revolutionize operating system architecture either. that doesn't mean i'm not excited about the potential of a new open-source general purpose operating system kernel written in Rust and entering the same space as the Linux kernel. it seems like a good fit for the language and an area where modernization is past due.
- saghm 9y agoFair enough, I definitely agree with everything you're saying. I took a little issue with the statement that "good programmers" know how to properly write safe C good though, as it not only is unnecessarily condescending but also glosses over the fact that even good programmers write code with bugs, and "knowing how" to do something properly doesn't mean you'll do it properly 100% of the time.
- jimktrains2 9y ago> Rust is basically C with hardcoded checks enforced and put in by compiler that good programmers already know to put in. I have a feeling you know absolutely nothing about rust. Even the best programmers and programs in C have issues with what the borrow checker will catch. Moreover, the expressiveness of the type system is world's above and beyond any other main-stream (so not Haskell or ocamel) language. Saying it's C with checks is like saying French and Hungarian are the same, but with some different words.
- cmrdporcupine 9y agoI think you are correct about Rust being substantially different from C, but that's a nasty way of saying it ("you know absolutely nothing about..."). Is it really necessary to speak that way?
- kevindqc 9y agoIt wasn't that nasty. Might just be because I have no sympathy for people saying things like they are fact, yet don't know what they are talking about.
- cbHXBY1D 9y agoExcept the context of the quote was OS architecture so dmitrygr was correct -- Rust will not provide different OS architectures. Moreover, it was mean-spirited. Probably because they were reacting to the second part of dmitrygr's quote.
- steveklabnik 9y agoOn a fundamental level, sure, a new language doesn't inherently make a new architecture possible. But you have to think of it from an affordance perspective: what architecture does Rust make easier or better? Consider the Stylo project in Firefox, for example. Yes, Mozilla could have done the parallelization in C++ instead of Rust. They even tried! Twice! But it failed both times. That doesn't mean that it's impossible. In my experience, this is what people mean when they say things like this.
- pjmlp 9y agoActually, it is more like "Same as Ada", but with curlys (oversimplifying here).
- steveklabnik 9y agoYou're missing some things. For example, the APIs you can expose in Rust can encode significantly more information than a C-based one can, given the strength of its typesystem. Of course, Rust doesn't have a stable ABI yet, but then again, neither do many OSes. We'll get there!
- adamnemecek 9y agoI was thinking something similar. Maybe I can pass a userspace closure into the kernel? Maybe I don't need the memory manager to be as beefy? Maybe the API can be fully reactive (idk if this is good or not).
- steveklabnik 9y agoOne thing, and one that's relevant to an OS class, that I've been doing with my own toy kernel (that I haven't had any time for lately) is using Cargo workspaces to make it extremely modular. You can of course do this in C, but it's even easier with Cargo. In a class context, you could do something like "here's the entire OS except the scheduler package, implement it and make all the tests pass."
- adamnemecek 9y agoThis is true. I wonder if we'll see an OS where each of these modules has some sort of monadic (or maybe something else) API so that you can really decouple the implementation from the API. This exists: https://ocw.mit.edu/courses/mathematics/18-s996-category-theory-for-scientists-spring-2013/projects/MIT18_S996S13_Monad.pdf https://ocw.mit.edu/courses/mathematics/18-s996-category-the...
- dang 9y agoPlease don't post flamebait to HN. We don't want programming language flamewars, or any flamewars. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html