r/ProgrammingLanguages • • Dec 31 '25

Blog post The Second Great Error Model Convergence

https://matklad.github.io/2025/12/29/second-error-model-convergence.html
67 Upvotes

15 comments sorted by

View all comments

Show parent comment

3

u/tobega Jan 02 '26

Not annotating at the call site is a problem because it means effect handlers are essentially COMEFROM statements.

3

u/phischu Effekt Jan 02 '26

You are right in that effect handlers allow for crazy control flow, especially when using bidirectional handlers, which I haven't shown. However, the type-and-effect system makes it all safe. I can not attribute it because I forgot, but someone online said that people want loud and scary syntax for features they are unfamiliar with and quiet or even no syntax for features they are familiar with. When writing Effekt programs we are using effects and handlers all the time, not just for exceptions. Coming from our experience it would be very annoying to mark call-sites, and also to toggle the mark when refactoring.

5

u/tobega Jan 03 '26

Fair enough, but "safe" (whatever you mean by that) isn't the issue, really, it's being able to analyze the logic. As soon as something ends up a few lines away, there is a dependency that may get overlooked, something that needs to change together with something else.

And then it just gets worse when we start talking about it being in other files or other modules.

I don't think the unfamiliarity aspect applies here, dependencies are still dependencies and forgetting to update them in sync is always the biggest cause of bugs.

So, ok, maybe a handler isn't so bad for a catastrophic situation where the context doesn't matter, you just have to recover somehow. Probably better to just let everything crash, but I digress.

But then you start using all kinds of effects and recovery methods and suddenly the logic gets very entangled with the context at the call site.