Daily Thought - 2024-08-15
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.
I think yesterday's thought raises two questions:
- Couldn't we solve this, by teaching the type system about groups of closures, only one of which can be called? Then it should be fine for all closures in the group to ostensibly take ownership of the same linear value, because only one of them will actually do that.
- Isn't the problem that
if
is a built-in function? Can't it be made a special syntax then, that the compiler understands?
Both true! As for 1, that's basically what a pattern matching function is. I have some ideas for that, but let's save that for later. As for 2, that's exactly what I considered first. But then I thought, if I implement a special thing that the compiler needs to understand, why not try pattern matching instead? I'll go into the reasons for that tomorrow.
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.