Daily Note - 2025-04-27
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!
Newer functional languages like Koka and Unison do not necessarily track side effects by passing values between functions. They use algebraic effects. And with algebraic effects, you can write yesterday's example as a series of statements, just like you would in an imperative language.
I think this is what that would look like in Unison, for example:
do_a
then_do_b
lastly_do_c
And despite this looking pretty much the same as imperative code with implicit side effects, the effects of each function are known to the compiler. You could look them up in the function definitions. In Crosscut, the editor could display the effects for you very explicitly, right where you use those effectful functions.
Over the last few months, I had gotten used to the functional "single expression" style. It took me a bit, to adjust to the thought of returning to the whole "series of statements" thing. But now I think that is a win. Algebraic effects retain the stringency of purely functional programming, while putting that in a syntactical package that is already familiar to most developers.
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.