kyren / piccolo

An experimental stackless Lua VM implemented in pure Rust
Creative Commons Zero v1.0 Universal
1.62k stars 59 forks source link

Implement async sequences #84

Closed kyren closed 2 months ago

kyren commented 2 months ago

The only other question is whether having the async sequences return something equivalent to CallbackReturn would lead to a cleaner API or implementation -- I'm not sure, but it seems like could simplify some of the internal logic for polling the future. (The current approach is fine, though, and changing it later wouldn't require significant changes to user code.)

We could do this... really I just wanted to stem the proliferation of return types.

I think the internal logic after it was changed to panic under misuse is not so bad?

(I know I merged the PR already but it can be changed, I just don't want to delay trying to use this to implement tricky parts of the stdlib)