Rust Iterator Items An exploration of syntax
TL;DR: I think we should add generators to Rust. I’ve implemented a prototype of my proposal using a procedural macro, and I would love people to open issues and/or PRs with implementations or potential syntax and other ideas around the syntax of the feature.
Learnt a lot about programming language syntax and design trade offs from this one.
“I believe such a feature in Rust would be desirable. This might not give you the full flexibility of writing impl Iterator by hand, but I think it would cover the vast majority of cases people care about and are now stopped by the sudden complexity hurdle.”Posted on 2021-11-11T07:11:47+0000