Daily Thought - 2025-02-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!
Yesterday, I started introducing the new syntax and evaluation model. It takes inspiration from functional languages, and limits functions to having exactly one input and one output value. That might seem too restrictive: some operations just have multiple inputs. Otherwise, how would you model something like addition or multiplication?
Functional languages like Haskell or the ML family, get around that by using
currying. Consider something like + 1 2
(which is a syntax that neither of
the aforementioned languages use for addition; but let's stick with it for this
example). This isn't actually a single call taking two arguments; it's two
function calls, taking one argument each!
The first call (or application, as the more math-minded functional languages
call it) is + 1
. It returns a new function, which takes a single argument and
adds 1
to it. That new function is what receives the argument 2
. I don't
think this would work with postfix syntax though. So we need a different
solution.
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.