Crosscut

Daily Thought - 2025-04-17

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've come to believe that automatic lifting won't work in practice. It definitely would for the simple case: Imagine a variant { A, B } and two functions f: A -> X and g: B -> X. Apply f and you end up with variant { X, B }. Apply g and you get variant { A, X }. Easy.

But what about generic functions? If you have a function that takes a generic type T, how do you apply it? To A? To B? To the whole variant? Unless there is some constraint on T that only makes one of those options possible, it's unclear.

The language could have rules for that, that favor one option over others. Or require the user to always explicitly state what to do in such a case. It's not an unsolvable problem. But automatic lifting is supposed to make things smooth and easy. If it introduces a complication in this common case (which I expect generic functions to be), then it defeats its own purpose.

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.