Crosscut

Daily Thought - 2024-06-23

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 has a stack-based evaluation model. But despite that, functions have to specify named arguments. In addition, you can bind values to names within a function.

Here's some pseudocode (because again, Caterpillar still has no syntax):

fn square_then_times_five ( x )
{
    x x * => squared .
    squared 5 * => times_five .
    times_five
}

Here, each intermediate result is bound to a name. In most languages, this would be called a "variable", but in Caterpillar they are called "bindings". (Because they are supposed to be immutable, i.e. not actually variable.)

<< 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.