Crosscut

Daily Thought - 2024-10-09

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

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.

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