5 ms·
Yes, but the point was that it could be done in rust, using rust's language features (type safety and so forth). Making your main inline assembly isn't really u
by ekimekim 12y ago
Yes, but the point was that it could be done in rust, using rust's language features (type safety and so forth). Making your main inline assembly isn't really using the language very much.
- omega_rythm 12y agoYou really should have a look at the rust code this guy wrote. I would not call that last optimization type safe.
- the_mitsuhiko 12y agoHow so? The only unsafe part is the transmute which only saves 7 bytes anyways :P
- exprL 12y agoEven that is still type safe, just not portable. After all, every part of the memory is a collection of bytes (that is, a slice of u8) – whether you can access them is another story.
- userbinator 12y agoFrom the Github page: https://github.com/kmcallister/tiny-rust-demo https://github.com/kmcallister/tiny-rust-demo All of the machine code comes out of rustc. (Although all of the instructions that survive optimization went in as inline assembly.) So while his main() is written in (unsafe) Rust, he's basically using it as a macroassembler.