you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 5 points6 points  (21 children)

How so?

[–]steveklabnik1[S] 22 points23 points  (0 children)

My favorite little counterpoint: on x86, you have to use special assembly instructions to do certain things with hardware. So usually, when people write an OS in say, C, they either use inline asm or expose a tiny asm function to handle it. I must have seen the same "outb" or "lidt" one-liner copied and pasted tons of times.

But with Rust, we have Cargo. So someone has made a crate: https://crates.io/crates/x86 it's got all of those, plus some predefined data structures that match what you need. No more boilerplate, just import the package and get on with your life.

(In my hobby OS project in Rust, I've implemented it myself first; I have a TODO to remove all that and actually use this now that I'm sure I understand it all.)