Live data from Hacker News

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

slideshare.net

21–30 of 144 posts

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

#22

Rust allows for new architectures. Eg beos style os would be a match made in heaven as rust really shines when it comes to async code. Also maybe you could have a less complicated memory manager as you can deal with allocations statically.

"rust really shines" they need to land async/await

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

#23

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…

That's what nebulet is doing!

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

#28

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…

>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.

Please just... stop. You are using terms that you clearly don't understand the meaning of. What is a "monolith" from your point of view? Because I can tell you that Windows NT is most certainly not a monolithic kernel. Its architecture is very much that of an impure hybrid kernel. You're using the term "monolith" as some sort of buzzword in a realm where that exact term already has a highly specific meaning.

>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,

Yes, but some (e.g. ripgrep) don't actually do the same thing as the programs they are supposed to "re-implement". Most Rust "re-implementations" don't actually re-implement programs, they are new programs doing a similar-but-not-quite-the-same thing to the older C implementations. For example, ripgrep is neither GNU or POSIX compliant, and therefore it is not a re-implementation.

>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.

Hybrid kernels have absolutely nothing to do with the language they are written in beyond the fact that they're written in it. Monolithic, hybrid, microkernels and exokernels are all terms to describe the architecture of a kernel.

>So one outcome would be a lot of Rust code running in a wasm sandbox on top of legacy kernels.

So then Rust and wasm isn't a part of the kernel is what you're saying.

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

#29
post #21
post #4

Presentation by the Joyent CTO btw, who hired a lot of the old Sun Solaris team.

Among other things because he is also was part of the old Solaris team?

Hilarious example of why English is a terrible language: I meant for the the pronoun to refer to Joyent, not [necessarily] the CTO.

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

#30
Bit of a mixed bag.

Slide 12:

> Go etc. are garbage collected, making interacting with C either impossible or excruciatingly slow.

"Impossible" is, of course, a lie. "Excruciatingly slow" may be the case, though it depends on the kind of interaction you are looking at. Without any context, this statement is overly general.

Slide 14 can be taken out of context and misrepresented as showing that "Rust can be faster than C", although the programs being compared use different data structures, so it's inconclusive. (It's not clear to me whether the author wanted to make a broad claim like this. The title suggests so, but again, the difference in data structures suggests otherwise.)

Slide 16:

> every operating system retains some assembly for reasons of performance

Is this really the case? I would be interested in examples. My impression was that assembly is needed for hardware interaction for which there are simply no C constructs available (setting timers, interrupts, system registers, and whatnot), and possibly highly space-constrained bootloader stuff, but performance? C compilers are not stupid.

Slide 19:

> in-kernel C tends to be de facto safe

This is a bit of a stretch. I mean, yes, most lines of the Linux kernel have never been the cause of a CVE. But it's hard to tell which lines are the critical ones. Properly encapsulating safe/unsafe regions does seem like an improvement. (My understanding is that Rust's "unsafe" is not properly encapsulated: You might mess something up that will cause a segfault later on, in ostensibly "safe" code. Still, it's a step forward.)

Post reply on HN