Crosscut

Daily Thought - 2024-08-26

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

There's one assumption in yesterday's thought that I'd like to call out: The easy fix for determining the active expression in a reconstructed stack frame depends on functions having exactly one exit point. If you allow early returns, then functions can have multiple of those, and suddenly this is no longer possible.

I use early returns in Rust, but discovered that they are more controversial than I thought. Many seem to favor coding styles that avoid them completely, claiming it will lead to cleaner code. Even before I came across call stack reconstruction, I had decided I wanted to try that style in Caterpillar. Now it turns out, this is critical for supporting this important feature.

This leads into a larger theme: Restricting what the language can do, making it more simple as a result, can make it easier to understand. By the developer, hopefully, but also by tooling (which then benefits the developer indirectly). This is something that I want to explore in the design of Caterpillar. The result will be unfamiliar to many, but I hope lead to a better experience.

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