Crosscut

Daily Note - 2025-04-26

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!

Imperative languages tend to express operations as a series of independent statements. Code like this should be very familiar to most of us:

do_a();
then_do_b();
lastly_do_c();

This kind of code only makes sense, if those three functions have some kind of side effect. They don't take and return any values, after all. So without a side effect, neither of them would actually do anything.

Since purely functional languages track effects explicitly, traditionally by using values, you would, at the very least, need to pass some value through these functions to make that work. Maybe like this:

lastly_do_c(then_do_b(do_a(thing_required_for_a)))

Or, maybe more clearly, like this:

thing_required_for_a |> do_a |> then_do_b |> lastly_do_c

This is a distinction that arises naturally from the differences in how those languages tend to work. With imperative languages, you get a series of statements. With functional ones, function bodies tend to be single expressions. Except, this distinction is no longer so clear when you consider a new generation of functional languages. Let's get into that tomorrow.

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.