Daily Thought - 2024-12-16
< back to listAll kinds of behavior can be covered by effects. Where a given language lands with that, is going to depend on its design goals. In Caterpillar, pretty much everything, except pure computation is an effect, making it trivial to run the language in a sandbox and port it to different platforms. (Thought it also introduces overhead, conceptually in potentially in terms of performance.)
Having a unified system in the language to govern effects is kinda nice, leading to more coherence, consistency, and expressive power. But how does that help us with the problem of abstraction that ad-hoc effects necessarily present?
Well, so far we've been missing the essential part that turns an effect system into an algebraic effect system: Effects need to be part of the type system. And the type system must provide facilities to abstract over them. If a function can say, "and by the way, I also have all the effects of the function you pass to me", that can be a solution to the mess.
Hey, you! Want to subscribe to my daily thoughts? Just let me know (maybe include a nice message, if you're up for it), and I'll send you an email whenever I post a new one.