Effect handlers (tracking issue) #263
Labels
documentation
Improvements or additions to documentation
effect-handlers
enhancement
New feature or request
Here are some problems left in the original PR (#257) that still need to be addressed.
Code documentation
Interactions with initialization
handle
statements should not be followed by object initialization code: Function instrumentation and effect handlers transformation #257 (review)Bug fixes
Fix bug that was introduced or uncovered after the big refactoring (f764eb9)
Details
mlscript/hkmc2/shared/src/test/mlscript/handlers/EffectsInClasses.mls
Lines 9 to 55 in f764eb9
Instrumentation seems to break with the following test: https://github.com/CAG2Mark/mlscript/blob/handler-fixes/hkmc2/shared/src/test/mlscript/handlers/ZCombinatorHandler.mls (edit: it's due to stuff after tail-calls not being resumed as a result of the handler tail-call optimization, it's being fixed right now)
This fails to print "b"
Fix bug related to nested handlers and non-tail resumptive handlers (ea34066)
Verify assertion added in (ea34066) always hold or fix those cases.
Missing implementations
Optimizations
switch
statements instead of nestedif (this.pc === ...)
statementsresume
continuationclass Cont with {constructor(pc) ...}
rather thanclass Cont(pc) with {...}
, as the latter generates an additional function, which here is superfluous. However, theconstructor
syntax is not yet (fully?) supported in the new compiler.Benchmarking
async
map
function and how it scales in both cases)Future possible features to add
sync
function modifier to compile a function without instrumentationsync
expression modifier to compile a function call without instrumentationonSuspend
,onResume
,onUnwind
, if they exist, when appropriate to handle resourcesThe text was updated successfully, but these errors were encountered: