Daily Thought - 2025-02-08
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!
The postfix syntax in previous prototypes was supported by a stack-based evaluation model, which turned out to be problematic. The new model I came up with after briefly trying, then dismissing, a more traditional approach, is also using postfix syntax. But it's not supported by a stack-based evaluation model.
This model takes inspiration from functional languages like Haskell or the ML family (and thus indirectly from lambda calculus). In those languages, functions accept exactly one argument and return one result. Compared to the arbitrary number of inputs and outputs that the stack-based model enables, this is a welcome simplification.
And I do believe that this limitation fits postfix syntax quite well. It makes
both control flow and data flow very obvious. You see code like a b c
, and you
immediately know that a
is executed first and produces something that is then
processed by b
, which then in turn gives its result to c
. There's more to
it, because this alone would be very limiting. But that's a topic for tomorrow.
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.