Live data from Hacker News

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

slideshare.net

121–130 of 144 posts

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

#121
post #21

Earlier quoted context omitted.

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.

RUSTful English officially needs to be thing

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

#123

Earlier quoted context omitted.

Any dynamic memory allocation lacks determinism, which is why in high integrity systems it often forbidden to dynamically allocate memory. As for Rust can be faster than C, well, people said the same about Ada but it rarely is the case so I wouldn't hold my breath for Rust either. After all, those languages use the same backends - GCC in the case of C & Ada, LLVM in the case of C & Rust. But it's enough to as fast as…

> After all, those languages use the same backends - GCC in the case of C & Ada, LLVM in the case of C & Rust. The killer flaw of C for performance is the pointer aliasing problem. C only has the very coarse-grained tools of strict aliasing (often disabled in large applications because it breaks code!) and restrict (which relies heavily on manual programmer annotation) to control these aliasing issues. Since Rust has…

I think it's fair to say that "average" Rust code will be faster than "average" C code due to lack of pointer aliasing issues as the average developer doesn't care about/understand this enough to make the annotations in any codebase I've worked in. Can you make both equally fast? I don't see why not, they're both LLVM.

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

#124
post #102

Earlier quoted context omitted.

Because it is a big difference to have 100% of the code unsafe or just a set of visible code regions marked as such.

Hyperbole, or do really believe every line of C is unsafe, in the literal sense, by default? Pray tell me what is the difference between // safe, tested, C ... // potentially dangerous C deemed thus for whatever arbitrary reason And // "safe" Rust ... // "unsafe" Rust

Life experience since I touched C for the first time in 1992.

So yes I do belive, given the quality of the code bases I have seen in production.

And as discussed at Linux Kernel Security Summit 2018, which videos are freely available for you to watch as well, even with the rigorous process to accept patchs into the kernel, CVEs keep increasing.

68% of them were caused by memory corruption, something mostly unique to C and languages that are copy-paste compatible with it.

Then another good chunk was related to UB, something that even Linus already ranted a few times.

So yeah, Safe C is an oxymoron, unless we are talking about a new variant with safety turned on by default, where warnings are dealt as errors and everyone uses static analysers that break their CI builds on error.

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

#126
post #119

Earlier quoted context omitted.

Until Blackberry bought it, it was open source. There were free downloads. Now it's proprietary. But there's a lot of info out there from the open source era. The manuals are available. Here's the original QNX paper.[1] [1] https://cseweb.ucsd.edu/~voelker/cse221/papers/qnx-paper92.p...

I am amazed that I cannot find a copy of the source code from the time it was freely available now.

Here's the 2007 press release announcing QNX going open source.[1]

On April 9, 2010, the day the acquisition closed, Research and Motion took the source code offline, with no notice. All user open source projects on QNX were abandoned shortly thereafter.[2]

[1] http://www.qnx.com/news/pr_2471_1.html

[2] https://community.qnx.com/sf/sfmain/do/listProjects

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

#127

Earlier quoted context omitted.

> After all, those languages use the same backends - GCC in the case of C & Ada, LLVM in the case of C & Rust. The killer flaw of C for performance is the pointer aliasing problem. C only has the very coarse-grained tools of strict aliasing (often disabled in large applications because it breaks code!) and restrict (which relies heavily on manual programmer annotation) to control these aliasing issues. Since Rust has…

I think it's fair to say that "average" Rust code will be faster than "average" C code due to lack of pointer aliasing issues as the average developer doesn't care about/understand this enough to make the annotations in any codebase I've worked in. Can you make both equally fast? I don't see why not, they're both LLVM.

Given enough time, effort and smarts, you can probably make any lang as fast as any other :-)

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

#128
post #39

Earlier quoted context omitted.

No, that's an example of someone not knowing the language very well. You should have written something like, "which is the company that...". I can't think offhand of any language that's really better here in a sense of being more efficient, except probably Classical Latin which is horribly complicated and of course a dead language.

Czech allows you to specify that with a change of one letter depending on who you mean (the CTO - který, the company - která) - this depends on different genders of the two words, but is commonly used.

I think using `which` instead of `who` would have been sufficient in this case; but this is a non-general fix for similar reasons

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

#129

Earlier quoted context omitted.

Why should the GC not be able to inform the programmer/language designer when memory is discarded? This is a non-issue. Besides, a kernel has to deal with plenty of forms of nondeterminism anyway.

How would the GC in this case inform you when an object is deallocated? The whole point is scope can be extended arbitrarily by anything and that finalization may happen, or it may not, at some point in the future.

In the same way as a kernel deals with e.g. with the question whether an I/O interaction has succeeded or failed? But there is a difference, a GC can guarantee that finalization will happen in the future, unless someone switches off the machine by pressing the power button. I/O cannot make this guarantee.

Do you maybe have hard real-time systems in mind when you say "deterministic"? I agree that a GC would be a bad idea for those, but these require validation of the hardware in combination with the software anyway.

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

#130

Earlier quoted context omitted.

Any dynamic memory allocation lacks determinism, which is why in high integrity systems it often forbidden to dynamically allocate memory. As for Rust can be faster than C, well, people said the same about Ada but it rarely is the case so I wouldn't hold my breath for Rust either. After all, those languages use the same backends - GCC in the case of C & Ada, LLVM in the case of C & Rust. But it's enough to as fast as…

Rust doesn't require a heap, you can use it fully statically and still get the deterministic destructors when your stack object is destroyed.

The same for Ada, and it also has strict aliasing rules, but that hasn't made it faster than C historically. It's in the same ballpark as C, though.
Post reply on HN