4 ms·
Rust iterators are hard to implement without a big compile time hit.
by edflsafoiewq 5y ago
Rust iterators are hard to implement without a big compile time hit.
- uh_uh 5y agoCompile time hit meaning it's difficult to get the types right or something else?
- runeks 5y agoPresumably that it’s inherently slow to compile. “Getting the types right” happens before compile time.
- masklinn 5y agoThat they rely on a lot of optimisations to be really efficient (= have any chance of approaching a regular for loop). Without that, every adapter adds a function call to the yielding of an element.