Skip to content
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

Add support for coroutines #3

Open
ecton opened this issue Feb 13, 2024 · 0 comments
Open

Add support for coroutines #3

ecton opened this issue Feb 13, 2024 · 0 comments

Comments

@ecton
Copy link
Member

ecton commented Feb 13, 2024

This is going to require the ability to temporarily swap the executing stack.

We may want to move "step" and all of its related functionality to a new type that receives a mut slice of the current stack. The Function type can have a stack and a current instruction that the interpreter uses when present and jumping into a function.

We can use the fairly-standard yield keyword: yield <Expression> ('to' <Expression>)?.

I'm sure it will end up being a little more complicated than this, for example, how to support the more verbose coroutine functionality alongside the simplified generator interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant