Daily Note - 2025-04-29
Hey, I'm Hanno! These are my daily notes on Crosscut, the programming language I'm creating. If you have any questions, comments, or feedback, please get in touch!
As I've been publishing these notes on algebraic effects over the last few days, I noticed a weird gap in my thinking: Why does giving up on linear types mean that we need monads or algebraic effects for tracking side effects? Couldn't we stay with the same approach, but use affine types instead of linear ones?
The difference between affine and linear types is that you always have to explicitly handle values of linear types, while you can implicitly drop values of affine types. For example, if a value represents a file, you would have to explicitly close it, if it's linear. If it's affine, you can just ignore it. At the end of the scope, it will drop and close itself in the background.
That means affine types lack the quality that makes linear types not interact well with many other features. But they still enable the same move semantics that allow using values to track side effects. I don't know what to make of that yet, and I'll be thinking about it in the background. But now, it's time to finally talk about the latest changes.
Hey, you! Want to subscribe to my daily notes? 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.