Crosscut

Daily Thought - 2025-02-12

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!

Okay, so we're using postfix syntax, functions have one input and one output, and composite values are a thing. I already talked about why I like postfix syntax, but I want to highlight one aspect in particular, that I didn't fully appreciate until my latest detour into the prefix world.

Here's a piece of code in postfix syntax:

first_do_this then_this finally_this

Here's the same piece of code, in prefix syntax:

finally_this(then_this(first_do_this()))

I realize that prefix syntax is more familiar to most people, which translates into being more intuitive. (Which many people, erroneously, then view as a fixed quality; not as just a consequence of familiarity.) But I dare you to tell me that the example above is easier to understand in prefix syntax, where you have to read it inside-out, instead of in the order you'd write it in.

This difference is more pronounced, if you work in an interactive environment, that executes your code as you type it. The postfix example above, you can type start to finish, and you'll see intermediate results as they become available. The prefix example, you either type inside out, which results in more editing. Or you type it left-to-right, and then only get a result when you're finished.

Maybe this won't make that much of a difference under realistic circumstances. I don't know, because I haven't gotten so far that I could experience that. But working with prototype 12, my brief detour into prefix syntax, this effect was really obvious. And working with the new prototype now, the increase in immediacy is striking.

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.