-
Notifications
You must be signed in to change notification settings - Fork 30
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
JS runtime: Extract RESUME
function
#708
Conversation
libraries/js/effekt_runtime.js
Outdated
meta.stack = null | ||
return body(resumeComp, meta, k1) | ||
const resume = (c, ks, k) => RESUME(c, cont, ks, k) | ||
return body(resume, meta, k1) |
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 you plan to change this to:
body(c, meta, k1)
?
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.
No, I think it would not work if I did so.
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.
Here I am doing the same (modulo direct style)
effekt/libraries/js/effekt_runtime.js
Line 125 in e866700
return [cont, meta, k1] |
This requires changes to the transformation, like in the other PR #679 .
effekt/effekt/shared/src/main/scala/effekt/cps/Transformer.scala
Lines 147 to 152 in e866700
case core.Stmt.Resume(cont, body) => | |
val ks2 = Id("ks") | |
val k2 = Id("k") | |
Resume(cont.id, Block.BlockLit(Nil, Nil, ks2, k2, transform(body, ks2, Continuation.Dynamic(k2))), | |
MetaCont(ks), k.reify) |
I took the liberty to make the above mentioned changes. |
Was just about to push the cherry-picked commits myself. Thanks for the help, though :) |
Sorry if this duplicated work that you wanted to do :( |
From my side, we can merge this now. Thanks for your help -- finally I can put #679 to rest :) |
Not sure whether I was of much help here, but sure :) LGTM |
Co-authored-by: Jonathan Brachthäuser <jonathan@b-studios.de>
No description provided.