Live data from Hacker News

Is it time to rewrite the operating system in Rust? [slides]

slideshare.net

11–20 of 144 posts

Re: Is it time to rewrite the operating system in Rust? [slides]

#14
post #7
post #5

no.

I was expecting to see this type of response. I don't program at low levels but it seems like this would be the responding answer. Kernel programmers would be using something else if that's what they wanted to use. Decades of experience and hard learnt lessons down the drain.

On the other hand, the design of Rust is directly and deeply influenced by those very lessons.

Less “down the drain,” possibly more close to “baked directly into the tools we use.”

Re: Is it time to rewrite the operating system in Rust? [slides]

#16
post #8
post #7

Earlier quoted context omitted.

I was expecting to see this type of response. I don't program at low levels but it seems like this would be the responding answer. Kernel programmers would be using something else if that's what they wanted to use. Decades of experience and hard learnt lessons down the drain.

Also, if you can abstract away at a sufficiently low level why not just do it in C where there's already a generation of experience and familiarity?

Sure, why not just continue writing C for the rest of time?

Re: Is it time to rewrite the operating system in Rust? [slides]

#17
These slides are quite high-level, so I've got to ask: what's the expected benefit of using Rust to implement a kernel? I somehow thought that nearly all interesting concurrency there would not fit into the paradigm of exclusive ownership. And if we are preaching for programming in unsafe Rust, then doesn't the message become less compelling?

Re: Is it time to rewrite the operating system in Rust? [slides]

#18
I think the question is wrong. People are already writing new operating systems in Rust just because they can. The question is whether we will end up using their efforts or whether we keep on going back to the same monolith kernels we have been using for the last thirty years or so. Whether it is NT, Linux, or any of the BSD kernels, they each have decades of history behind them.

These will of course still be around for the foreseeable future (i.e. decades). At the same time, we are seeing Rust pop up in a lot of places that used to be the exclusive domain of C. People are already re-implementing libraries, popular command line tools, etc. A lot of these implementations have clear merit in the sense that they are faster, safer to use, easier to scale, maintain, etc.

IMHO it is just a matter of time before vendors start providing e.g. drivers written in Rust for their hardware. I could see linux evolve to a point where integrating drivers like that is both possible and common. Once that happens, it will be a hybrid kernel effectively. Rust is not the only thing moving that direction; wasm is also going that direction. People are talking about running that in the kernel. And of course Rust runs on top of that as well. So one outcome would be a lot of Rust code running in a wasm sandbox on top of legacy kernels.

Re: Is it time to rewrite the operating system in Rust? [slides]

#19

These slides are quite high-level, so I've got to ask: what's the expected benefit of using Rust to implement a kernel? I somehow thought that nearly all interesting concurrency there would not fit into the paradigm of exclusive ownership. And if we are preaching for programming in unsafe Rust, then doesn't the message become less compelling?

In practice, even in redox there’s not as much unsafe code as you might think.

Re: Is it time to rewrite the operating system in Rust? [slides]

#20

These slides are quite high-level, so I've got to ask: what's the expected benefit of using Rust to implement a kernel? I somehow thought that nearly all interesting concurrency there would not fit into the paradigm of exclusive ownership. And if we are preaching for programming in unsafe Rust, then doesn't the message become less compelling?

The purported benefit would be to wrap all of the unsafe bits in safe wrappers and then have a less bug prone, more secure OS, I suppose.

This would be, to put it mildly, quite difficult. Even then, unsafe code is sometimes not written correctly which brings the whole thing down.

I, personally, still think it's worth it. I think efforts like Redox OS can teach us a lot about what we're doing and offer a chance to collapse some of the layers of cruft existing OSes have accumulated.

Post reply on HN