Crosscut

Daily Thought - 2024-05-03

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!

This thought was published before Crosscut was called Crosscut! If it refers to "Caterpillar", that is the old name, just so you know.

< back to list

Caterpillar uses postfix operators, instead of the more common prefix and infix operators. Postfix operators are less familiar, which can make them unappealing. So why did I decide to go for them anyway?

First off, I'd like to observe that many languages provide all three kinds of operators. Let's take Rust as an example. It provides prefix operators through function calls (add(a, b)), infix operators through built-in operators (a + b), and a limited form of postfix operators through method calls ((a, b).add()).

I want to avoid this complexity in Caterpillar. Obviously, one of them would do; Lisp and Forth are proofs of that. And I believe, if you can only have one of the three, then it should be postfix. Over the next few days, I'd like to talk about why I think that is.

<< previous thoughtnext thought >>

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 whenever I post a new one.