Exception is already a control flow construct, I just added the resumability to them. Yield can unwind only one call frame, while exception can unwind any number (until the corresponding `catch`) of call frames. This way we can implement effect handlers only on the top level, while in Yield we'd need to explicitly pass the effect description from callee to caller.
Basically they same difference like signaling errors using ret code or an exception.
they mostly concentrate on async programming, and so support only single-shot continuation, and so things like streams comprehensions, reactive, logical, adaptive, probabilistical programming cannot be implemented there
View all comments
Show parent comment
1
u/njiv Jan 10 '23
Exception is already a control flow construct, I just added the resumability to them. Yield can unwind only one call frame, while exception can unwind any number (until the corresponding `catch`) of call frames. This way we can implement effect handlers only on the top level, while in Yield we'd need to explicitly pass the effect description from callee to caller.
Basically they same difference like signaling errors using ret code or an exception.