Crosscut

Daily Thought - 2024-08-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!

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

A while ago, I started talking about tail call elimination, before I got distracted and spent the next weeks talking about (and implementing!) pattern-matching functions instead.

So, Caterpillar does tail call elimination, happily omitting useless stack frames left and right. That's great! But what if your program hits a breakpoint, or some error condition? You would expect to see where that error happened, where the function was called from, where that function was called from, and so forth.

But where is the debugger supposed to get that information from? Well, the call stack. The same call stack that is full of gaps, thanks to tail call elimination. And showing information that's full of gaps is going to confuse the developer, which won't do. The solution to that problem is call stack reconstruction, and that's what I'd like to tackle next.

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