3 ms·
This is great, but I'm confused. Not that long ago, I remember reading that it was explicitly not a goal of Rust to be able to write an OS kernel in it. Is this
by andrewflnr 13y ago
This is great, but I'm confused. Not that long ago, I remember reading that it was explicitly not a goal of Rust to be able to write an OS kernel in it. Is this done in spite of Rust not being designed/suited for it?
- steveklabnik 13y agoI'm not sure that I've ever heard that as an implicit goal, but a 'runtime-less Rust' hasn't existed yet. Now, you can't access arbitrary memory without an unsafe block, that may be what you're thinking of. Recently, zero.rs was released, which allows you to write some Rust programs without the runtime. This is because Rust basically expects certain functions to exist, so they have to be defined somewhere. That said, things like 'a GC' aren't implementd, they just throw an error. Please see: https://news.ycombinator.com/item?id=5771173 https://news.ycombinator.com/item?id=5771173 This is just one step further in demonstrating that these things work.
- usea 13y agoA link to the HN thread on zero.rs https://news.ycombinator.com/item?id=5770212 https://news.ycombinator.com/item?id=5770212
- gillianseed 13y agoI'm sure they (the Rust developers) don't have any particular interest in writing an OS kernel using Rust, but that doesn't mean someone else can't give it a try. Of course it's hard to pass off these ~200 lines of code as an attempt at writing an OS kernel, but it could be a spark, everything starts somewhere.
- masklinn 13y ago> I remember reading that it was explicitly not a goal of Rust to be able to write an OS kernel in it. It's not a goal of rust, but that doesn't mean rust can't be used for it (and the ability to run without a runtime if desired — at the loss of functionalities for which a runtime support is necessary — has been a goal of the project for as long as I've known about it)
- pcwalton 13y agoOriginally we didn't think we could be that low-level and provide all the safety guarantees we wanted, but eventually as the language design matured we realized we could.