Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Fuchsia is the most serious OS that has significant components written in Rust at this moment, so this is pretty neat!


Depends on how you define "serious"; for desktop-ish, sure, but for embedded, for example, the Hubris OS we've written at Oxide is a key component of the entire company's product. There's a lot more diversity in the embedded space in general.


TIL about Hubris, very cool! One could probably also mention the bunch of hypervisors, as they run on the bare metal as well, and maybe Tock, and I'm probably unaware of a bunch. Rust is definitely a hot language when it comes to OS development, which is really great.

I've cloned hybris [0], it seems to have 48k lines of Rust source code. Maybe there are other components that I'm missing. Fuchsia [1] on the other hand had 2.1 million lines of Rust in Dec 2020 [2], and according to tokei has 3.3 million as of now (8b51db9e2b809, March 28 2022), more than it has C++ (2.2 million) and C (366k) combined.

For comparison, a full check out of the rust-lang/rust repo with all the submodules which contains rustc as well as tools like cargo, rustfmt or clippy, and their test suites, contains 2.1 million lines.

But yeah you can come up with several definitions of "serious". Is an OS that an entire company bases its revenues on more serious than a research project that some call as a way to maintain senior developer retention, but may one day replace components of one of the most deployed end user operating systems in the world?

[0]: https://github.com/oxidecomputer/hubris

[1]: https://fuchsia.googlesource.com/fuchsia/

[2]: https://www.reddit.com/r/rust/comments/k9djda/expanding_fuch...


> it seems to have 48k lines of Rust source code.

Yep, we are much smaller than Google and when you're fitting stuff into an embedded space, you need things to be much, much smaller. We couldn't fit the output of all that code on the chip even if we did write it.

If you do `cargo vendor` to make the comparison equal in that sense, loc (which I use instead of tokei for no real reason) says there's... 100MM lines of Rust? That seems like quite the bug, lol.

> Is an OS that an ....

Yep, agree 100%. It's part of why I found it so interesting you chose "serious" as the term; not that it's bad of course, but made me think of exactly this question. I have no idea what the answer is. I do think it's a good word to describe a difference between something intended for production and a hobby OS, of which we both know there are many in Rust.


Keep in mind that fuchsia vendors third party libraries, so a decent chunk of that code is third party libraries. That doesn't undermine what you've said, but I wanted to just highlight that not all 3M+ lines of code were written for fuchsia.


Good point, I've missed that. For a fair comparison with rustc or other OSs you should probably either vendor sources for the other code bases too too (e.g. for rustc take the official source tarballs), or delete the third_party/rust_crates directory in fuchsia. I did the latter and got 1.68 million lines of Rust in Fuchsia. Still quite impressive.


Redox OS is a serious effort focused on workstation use, and AIUI there are others as well for more embedded stuff.


Correct me if I'm wrong, but IIRC Redox has nobody working on it full time as part of their job? Fuchsia has whole teams.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: