Daily Note - 2025-05-12
Hey, I'm Hanno! These are my daily notes on Crosscut, the programming language I'm creating. If you have any questions, comments, or feedback, please get in touch!
With postfix syntax, yesterday's example would look like this:
_ # parameter
{} # body
fn
(You could argue that this is a backwards way to display a function literal, and that those should have special (prefix) syntax regardless of how the rest of the language looks. And I would agree. But remember, the priority right now is a minimal but working syntax. So this still supports my decision to switch to prefix right now. But back to the example.)
With restricted structural editing, you would only type
fn
, and the children (in this placeholder
form) are created automatically. And while that should
work great with prefix syntax, it would become very
weird with postfix.
For a start, note how the children are kinda sorted by
relevance, top to bottom, for a more natural way of
reading. This puts the more relevant child farther away
from the parent though, so after typing fn
,
you might want to navigate to the parameter to edit that
first, skipping the body, edit that afterwards, then
move beyond the fn
to type whatever comes
next.
(We could invert the order of the children, which might or might not be better. Just another example of the million little decisions you have to make, when operating in unfamiliar territory.)
So instead of just writing top to bottom, as we could with prefix syntax, we'd be skipping around the code, editing here and there. That's a lot of friction, to do something so simple.