Daily Note - 2024-10-09
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!
This note was published before Crosscut was called Crosscut! If it refers to "Caterpillar", that is the old name, just so you know.
The new function syntax I'm considering would require
new keywords (fn
and end
), and
thus prevent those names from being used for functions.
This is a general problem with keywords, at least those
that can't be restricted to a specific context. In this
case, both keywords could show up in the same contexts
as function calls.
But what if keywords had a special syntax? Like @fn
/@end
, for example. At first
glance, this seems too ugly and visually noisy for
something so pervasive. But the editor would do syntax
highlighting anyway, making the @
redundant. It could just omit it. Or render it so small
as to not hinder readability, while still making it
discoverable.
Also consider, that the editor could provide hints and
auto-complete. If you type if
, it could
offer to insert the keyword for you. Taken together,
this would make the @
more like a hotkey
for typing keywords, less part of the syntax.