Re:SIMD in Rust
by frozenport on Monday August 24, 2015 @10:25PM
(#10114175)
Weird question, where is the restrict keyword in Rust?
[ Parent
| on HN ]
Rust doesn't need such a mechanism, because by default Rust already has an enormous wealth of bulletproof data regarding the aliasing that goes on in your program. Controlling aliasing is in some sense what Rust is all about! :)
Re:SIMD in Rust
by shepmaster on Monday August 24, 2015 @11:03PM
(#10114352)
If I understand the keyword correctly, it's not really needed in Rust. The Rust compiler keeps very close track of who has a reference (many immutable or one mutable) to a value. There isn't really "accidental" aliasing.
That's awesome. It feels like this alone could, at least theoretically, make rust faster than C on average. Most C programmers are not even aware that the restrict keyword exists and don't use it in places where they could greatly benefit from it.