Crosscut

Daily Note - 2025-05-25

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!

The way many languages use the . syntax for methods is weird to me. It's not a general "postfix function application" syntax like pipe operators are. Instead, the first argument of the method is considered special, and that's the only thing that's put before the function:

arg1.function(arg2, arg3)

We end up with this weird between prefix and postfix syntax.

The first argument is not only syntactically special, but also semantically. It is the only argument used for dynamic dispatch (that's called single dispatch). There's also multiple dispatch, selecting a function (at runtime) based on the type of multiple arguments. This is very prominent in Julia, for example.

I don't know what role multiple dispatch will play in Crosscut, but keeping my options open here is another reason, in addition to the general weirdness, for not going with this syntax. But I guess there's still something to learn here, because this enables fluent interfaces, which can be nice. I don't know what to make of this yet, but I'm sure answers will reveal themselves in time.

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.