Daily Thought - 2025-04-13
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!
There is a rather straight-forward way to error handling that can meet my design goals, including the visibility that Rust lacks: exceptions.
Exceptions are familiar from many programming languages: They are values that any function can throw, interrupting what it's currently doing. The exception can then be caught by one of the function's callers. Either the direct caller, or any other up the call stack. If the exception is caught, the program continues there. If not, the program crashes with an error message.
The way most languages implement exceptions won't meet my design goals though. They usually don't show up in a function's signature. You'd be back to auditing your whole code to get on top of errors. But, there exists another variant of exceptions that would help: checked exceptions
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.