Crosscut

Daily Thought - 2024-12-11

Hey, I'm Hanno! These are my daily thoughts on Crosscut, the programming language I'm creating. If you have any questions, comments, or feedback, please get in touch!

This thought was published before Crosscut was called Crosscut! If it refers to "Caterpillar", that is the old name, just so you know.

< back to list

Algebraic effects are very powerful. But does that we want them? Support for async/await can be built into the language, if desired. Exceptions have gotten a bad reputation as a means of error handling (although I think it's their specific implementations that are problematic, not the concept itself), and we can do that instead by returning a result value.

So basically, there are simpler ways to get the main benefits that algebraic effects could give us. There's the argument that algebraic effects enable other use cases that we can't foresee yet, and giving developers that kind of power is inherently good. But I do think there are good reasons to have algebraic effects, aside from that.

Because, whether you model them in your language or not, effects are a thing. Attributes of functions like "is async", "can fail", "might not return a value"; those can be viewed as effects. If those are ad-hoc, meaning there's no principled effect system, then you can't abstract over them. And as I intend to show tomorrow, that is causing real issues.

<< previous thoughtnext thought >>

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.