Been thinking about how to implement try/catch in my VM only to realize it's literally just spicy on error goto, like, remember that one from qbasic?
It's just a label to jump to whenever an error is detected, which is just the catch block. So all I gotta do is check for an error after operations that can cause an error and then jump to the handler address if one is set, otherwise unwind the call stack and try again
gotos are a decent answer to quite a few problems, a lot of the issues people had with them was the abuse of the feature to create even bigger amounts of spaget. For example functions are essentially gotos, just with some implicit stack manipulation. There are plenty gotchas in my example but my point is goto isn't too different to following function/method calls