Algebraic Effects: Another mistake carried through to perfection?

https://news.ycombinator.com/rss Hits: 3
Summary

TL;DR: Effect systems are a hot area of current research. After a quick study of the current big ideas, I fail to see them yielding major practical benefits to the profession of software development. On the contrary, I have concerns. (Further discussion suggests good solutions are in development.) Algebraic Effects: Another mistake carried through to perfection? Effect systems are all the rage these days. Naturally, I had a look around to see what I could see about the topic. Honestly, I think the Ivory Tower is making a big fat mistake. I intend to show that effects share a common original sin with exceptions. That sin is the application of dynamic scope. Update: Several commentators say there are now effectful languages where the effects are done with lexical / static scope. In these languages, resumable effects are effectively parameters-of-procedure-type which may be implicit or explicit depending. So, for those languages the dynamic-scope objection fails. On the other hand: We have long known how to do statically-scoped procedure-parameters. To pass around a related cluster of procedure-parameters with some mutually-shared context, it begins to seem quite a lot like ordinary object-oriented dependency injection. Brief digression to explain what all the hype is about Think of exceptions. You know: try/catch/finally like in Java, C++, Python, Ruby, or your other favorite conventional language. Now think of resumable exceptions. A catch clause can return to the code what raised the exception, and possibly with an argument. Perhaps the handler got a record from a database, or used a GUI, or pulled it right out my anatomy. Matters not. Subprogram resumes, happy with its answer. How’s it work? You install handlers in the call stack, dynamic-scoped, with purpose-built syntax. Now, do you remember checked exceptions from Java? Yeah, everybody loved to hate on checked exceptions. The creator’s heart was in the right place, but the execution didn’t work out. Checked exce...

First seen: 2025-05-10 04:17

Last seen: 2025-05-10 06:17