Re:Rust Priorities after 1.0
by kibwen on Thursday April 16, 2015 @11:36PM
(#9392131)
Rust essentially never wastes cycles on bounds checking thanks to the design of its iterators. The Servo team tells me that bounds checking has never shown up in any performance profiles.
[ Parent
| on HN ]
Re:Rust Priorities after 1.0
by higherpurpose on Friday April 17, 2015 @03:51AM
(#9392773)
I wonder if after Mozilla writes Servo in Rust 1.x and Google sees how fast Servo is, even compared to its own JS engine, it will also consider writing a new JS engine in Rust 2.x (I assume, by then), as I doubt they'd use Go for that. Same for the whole browsers. Due to the safety features of Rust over C++ we might see both Firefox and Chrome be rewritten in Rust over the next 5 years.
Re:Rust Priorities after 1.0
by Ded7xSEoPKYNsDd on Friday April 17, 2015 @05:18AM
(#9393106)
Servo isn't a JS engine, it does make use of Firefox' SpiderMonkey, written in C++.
Re:Rust Priorities after 1.0
by captaincrowbar on Friday April 17, 2015 @12:09AM
(#9392215)
"Rust essentially never wastes cycles on bounds checking thanks to the design of its iterators."
Can you explain this or point me to the relevant documentation or code please?
The documentation on iterators describes the advantages of using iteration rather than direct indexing in a loop: http://doc.rust-lang.org/nightly/book/iterators.html
The gist is that an iterator has enough information about the thing that it's iterating over that we, as library authors, can avoid unnecessary bounds checking and just perform unchecked indexing while retaining all the safety. LLVM is also surprisingly good at automatically vectorizing our iterators.
Re:Rust Priorities after 1.0
by captaincrowbar on Friday April 17, 2015 @07:21PM
(#9397738)
Thanks!