Daily Thought - 2024-06-21
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.
Caterpillar has postfix operators, which imply a stack-based evaluation model. But Caterpillar isn't a stack-based language. (At least that's not what I would call it.) Because, while there is a "data stack" that functions operate on, it works differently than the data stacks in the stack-based languages that I've seen.
This starts with the name. I'm saying "data stack", because the context here is the difference between Caterpillar and stack-based languages. But that expression isn't even used in Caterpillar. Here, the values that are available to be operated on, are just called the "operands".
One big difference between these operands and a typical data stack, is that operands are local to a function. When you enter a function, there are no operands. While in a stack-based language, you'd have access to the same stack as the calling function. That raises the question, how are parameters passed in Caterpillar? I plan to answer that 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 whenever I post a new one.