-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generators #1832
Generators #1832
Conversation
I don't like this, some concrete reasons:
|
type Blocked = !; | ||
} | ||
``` | ||
Here we give `Blocked` the never type. This means that our executor can only run generators which do return `Blocked` from the `State` enum; since there aren't any instances of `!`. Our executor can only run generators which cannot block. This is why we call `()` the synchronous executor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"do" should be don't
The generality of your abstractions ( This all comes at the cost of potentially requiring some significant changes to standard library and possibly the compiler. I would appreciate the addition to this RFC of
Organizationally, it would be nice to move "Examples" to the end of the document. |
There hasn't been much activity here, but from things I've heard on IRC or elsewhere, I gather that @Zoxc wanted to close it and iterate some more in any case...@Zoxc, is that true? In general, my take on both this RFC and the stackless coroutines RFC is that we probably want to close them for now and spend a bit more time working through the constraints and goals. I know that @eddyb at some point felt like there was a big design space, and that it didn't make sense to pick a random point, but we should aim for something maximally minimal as a starting point. That intuitively makes sense to me -- but this RFC doesn't quite feel like that "max min" point to me. (The other RFC feels closer, but perhaps it also closes off too many avenues.) |
@nikomatsakis TBH I think both went into their own potentially dead-end paths, and we need to start with some smaller subset. Also, tunnel vision must be actively defended against (but I know that's hard 😢). |
@nikomatsakis I do want to close it, but I left it open to see if there was some valuable input. Must of the discussion seems to be in the other RFC though. I went down the path of removing the I also added immovable generators in addition to movable generators (hence the immovable types RFC), which isn't minimal, but would help immensely for writing efficient asynchronous code. We still want movable generators so we can write movable iterators, so having just immovable generators isn't a great option. I'd pick immovable generators over movable generators if we had to be minimal though, since they are more expressive and you can get movable generators by boxing them. I've run into problems thinking about implicit argument with lifetime variables to generators and a way to access them. My understanding of lifetimes need some improvement to resolve that. I also think we should consider other ways of having |
Team member @nikomatsakis has proposed to close this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once these reviewers reach consensus, this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period is now complete. |
Closing as per FCP. Discussion on this topic continues here. |
This is some friendly competition to Stackless coroutines #1823.
Rendered