Daily Thought - 2025-02-20
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!
Expressions are composed of syntax nodes. The syntax nodes we've seen so far, have one input and one output. Expressions made out of those are structured like a list. But there actually are (or rather, should be; I'm working on it) syntax nodes with multiple children. Which means expressions actually are trees.
There will be various syntax nodes with multiple children. For example composite types, tuples or records, which can be used to aggregate multiple values and pass them to a function together. I've shown what that could look like before:
(1, 2) +
Here we have a tuple value with two fields. Meaning in terms of syntax, we have
a tuple syntax node with two children. Each child gets is a separate
sub-expression, each of which starts with an active value of nothing
. In this
case, they both produce a value of type Integer
, creating the tuple (1, 2)
of type (Integer, Integer)
, which is passed to the function +
.
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.