Hacker News new | ask | show | jobs
by Thaxll 2903 days ago
I think at the OS level, safety from Rust are less useful. The "wrap unsafe code" doesn't really work.
4 comments

There’s a nice Stanford class I took called CS 140E that had students write an OS for the Raspeberry Pi in Rust. There are actually some benefits to using Rust at this level, though it can be a bit cumbersome at times.

Check it out here: https://web.stanford.edu/class/cs140e/

Interesting! One of the instructors is RocketMan. :-)

https://crates.io/crates/rocket

Have you tried it? My experience is that it works pretty well, though I've mostly been working on toys. Even bigger projects like Redox have shown that you generally don't need very much unsafe.
If you've written any amount of Rust then that's provably not true. You've no doubt used functions & methods that use unsafe (somewhere down along the line), and you didn't need to deal with it. That's 'wrapping unsafe code' used in practice. You got to write safe because someone else wrote the unsafe wrapper.
What do you mean, doesn't really work? In my experience, it works perfectly. Could you share more info?