4 ms·
After reading the discussion, I think I'm much more in favour of adding tail calls, than adding exceptions. Actually I wonder if one couldn't adapt the tail-ca
by j-pb 4y ago
After reading the discussion, I think I'm much more in favour of adding tail calls, than adding exceptions.
Actually I wonder if one couldn't adapt the tail-call mechanism slightly to also serve as an exception mechanism. I think you could do both by allowing `br` to jump to an arbitrary label previously established. An exception then simply being a "tail-call" that unwinds more than one stack frame, and calls into the "catch".
Not sure how well JITable this would be, but I think an arbitrary backjump and call should be mostly fine in terms of control flow?