Crosscut

Daily Thought - 2025-03-21

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!

I wonder if my idea from yesterday, to always automatically apply any function A -> B to any variant { A, ... }, turning it into a variant { B, ... }, is practical. If it is, that has profound consequences for error handling, and potentially other areas of the language.

A few months back, I published a series about algebraic effects. While I found a lot to like about them, it turned out they don't interact well with linear types. So I've been thinking about alternatives.

Using variant types in this way could be a solution, at least for error handling. We wouldn't need an error effect, or early returns, nor would we need to deal with monads. Functions could be straight-forward, linear series of instructions, with a single exit point at the end.

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 every time I post a new one.