-
Notifications
You must be signed in to change notification settings - Fork 52
[interpreter] Threading #179
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
Conversation
Sorry for the noise, but just wanted to say seriously thanks for working on this! golang said they would implement threads once this moves to stage 3 :D -- excited adopter of wasm |
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.
Is it possible to lift the either
combinator so that it applies to lists of values, rather than individual values (see comment on multi-value below)?
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.
LGTM
I see that wait/notify
implementations are stubbed out - would these need refactorings to implement?
Good question, I don't know. I hope not. |
This adds threading support to the interpreter:
thread
andwait
script commands for spawning and joining threads.either
result pattern for testing non-deterministic results.thread
andwait
(not yet fleshed out).This includes scripting functionality as discussed in #163. However, I decided to make sharing more explicit with
(sharing ...)
annotations in a thread definition, because it's more readable, avoids funny errors, and it's probably gonna be easier to implement in the JS converter that way. See test for how it's used.Sorry for the large PR, this required more refactoring than I anticipated. In particular, the whole script runner had to effectively be transformed from big step to small step. Similarly, Eval.invoke and Eval.init needed to become small steps.