Daily Thought - 2025-01-24
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!
In a stack-based evaluation model, expressions form a graph instead of a tree. That does have some subtle but profound consequences, as the flow of data becomes more complicated to keep track of. For the developer, but also for algorithms that need to process code. This causes problems.
A minor (but I think still important) one, is automatic formatting. If your expressions form a tree, that's straight-forward: A node's children are indented one level more deeply than the node itself. If they form a graph, that approach won't work. You'll need more complicated measures than that, to express the dependencies between expressions visually.
Another problem is type inference, which is already a difficult topic, inherently. Making the flow of data more complicated, makes this hard problem even harder. Or, how do you express that a function doesn't return? If you don't have a single return value, then you can't just declare that as having an empty type.
Lots of questions to answer, and complications to deal with.
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.