On Mon, Dec 07, 2009 at 10:33:39AM -0500, Andrew Whitworth wrote:
> 5) Demand (and enforce) all exception handlers have explicit end
> points, to prevent execution from just continuing to the end of the
> program: step 5 in the list above. This would require massive
> refactoring of PIR code to create a clear demarcation between handlers
> and other code. Sub-based handlers is just one implementation of this
> that uses existing language features to enforce the beginning and end
> of the handler
A point of clarification: I believe it's only the "and enforce"
part of this statement that requires a massive refactoring of PIR code.
We can certainly define an API that says that well-behaved exception
handlers must have explicit end points, and any handlers that don't
follow that API have to live with (or otherwise "handle") the
consequences.
> I'm sure there are a few more solutions that could be found too, but
> none of them are going to be 100% good to 100% of our users. I think
> we're going to have to start making sacrifices at the alter here,
> there's no way we're going to solve this problem in a reasonable way
> and keep every semantical nuance that we have now.
If we simply postpone the "and enforce" part of your last item, then
I think we end up with something that
(1) is achievable in a very short timeframe,
(2) provides a mechanism to resolve the immediate issues,
(3) allows existing code to continue to "work" as before
(with the same issues as before),
(4) is certainly no worse than what we have now,
(5) doesn't limit us on future improvements to enforce constraints.
In particular, I think that if we simply provide an opcode or method
that an ExceptionHandler (or Continuation?) can use to explicitly
request the longjmp back into the original runloop, then we solve
the largest part of the current issue. In other words, we establish a
convention -- enforcement to come later -- that well-behaved
ExceptionHandlers either return control to the thrower or
explicitly signal (via opcode or method) that they are resuming
execution in the original context/runloop.
Pm
_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev