We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following program discovered by @timsueberkrueb prints something different when ran with optimisations than without:
effect flip(): Bool effect choice(): Bool def main() = { try { val x = do choice() val y = do choice() println(x.show ++ " " ++ y.show) } with choice { try { resume(do flip()) } with flip { resume(true) resume(false) } } }
~>
$ effekt --backend=js --no-optimize hello.effekt true true true false false true false false $ effekt --backend=js hello.effekt false false
The text was updated successfully, but these errors were encountered:
The following program works as expected with and without optimizations:
effect flip(): Bool effect choice(): Bool def main() = { try { try { val x = do choice() val y = do choice() println(x.show ++ " " ++ y.show) } with choice { resume(do flip()) } } with flip { resume(true) resume(false) } }
The only difference here is that flip is handled in the outer scope.
flip
Sorry, something went wrong.
The optimised IR of the program in the issue description looks like:
def main() = { val x: Bool = reset { {p1} => shift(p1) { {k1} => val _1: Unit = resume(k1) { return true }; resume(k1) { return false } } }; val y: Bool = reset { {p2} => shift(p2) { {k2} => val _2: Unit = resume(k2) { return true }; resume(k2) { return false } } }; val v_r_left: String = if (x) { return "true" } else { return "false" }; val v_r_right: String = if (y) { return "true" } else { return "false" }; let tmp = println(infixConcat(infixConcat(v_r_left, " "), v_r_right)) return tmp }
Successfully merging a pull request may close this issue.
The following program discovered by @timsueberkrueb prints something different when ran with optimisations than without:
~>
The text was updated successfully, but these errors were encountered: