Rust's iterators are fast and can match loops with preallocation!
miniblog.
Related Posts
I find myself writing .iter().map(|x| ...).collect() really often in Rust. I'm wondering if I should write a helper method on Vec, but it seems less idiomatic.
Iterators compose, but they're less versatile (no indexing) and awkward to return from functions.
An overlooked PL question: what is easy to try in a given language? In lisp it's easy to try adding extra syntax. In Rust it's easy to try parallelism on iterators (rayon).
Are there other examples? Perhaps Perl and regexes or Haskell and STM?
Iterators: Signs of Weakness in Object-Oriented Languages https://www.pipeline.com/~hbaker1/Iterator.html (argues against iterators due to the hidden state)