Crosscut

Daily Thought - 2025-02-15

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 think it has become clear, that I like postfix syntax. But I also think that prefix syntax has one critical advantage that is too big to ignore: It gives you the context of what's happening first, which helps you understand the following details. (It might have more critical advantages. That's just the one that is very clear to me right now.)

The problem, I believe, is that whether it's better to provide context first, or to present code in order of execution, depends on the specific situation. So either style is going to be worse sometimes. But just as we can invent language features to offset the disadvantage of prefix syntax, we can do the same for postfix syntax. Consider this:

(detail_a, detail_b)
    important_behavior_that_puts_the_details_into_context

We could invent some kind of optional prefix syntax to improve this example, like this:

important_behavior_that_puts_the_details_into_context:
    (detail_a, detail_b)

Here, the : (which might be too subtle, but it's just an example), marks the application of the function with the long name as using prefix syntax. We could choose to write it like that, whenever we think that provides an advantage.

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.