Bob Rogers wrote:
The attached patch adds a docs/pdds/pddXX_dynbind.pod file, which is
a proposal for dynamic binding in Parrot. Please give this a read, when
you have a chance, and let me know what you think. (For those who would
rather not patch their Parrot in order to read it, I also have it up on
my site at http://rgrjr.dyndns.org/perl/pddXX_dynbind.html .)
Thanks very much for putting this proposal together. You've worked
through a number of important issues. In general, you've got the right
idea. A few observations:
- It's not stack unwinding/rewinding, so let's not call it stack
unwinding/rewinding. Need a new phrase.
- "Store once" Locations isn't really a good fit for the dynamic nature
of Parrot.
- Overall, I want the implementation of dynamic binding to be tied in
more closely with the implementation of globals and lexicals.
Particularly lexicals. They're already operating under the same scope
constraints as locals. They already have storage for named variables
relevant to a particular scope, and the mechanism for handling scopes
within scopes.
- I like the idea of "thread locals": global variables shared across
threads, but with a local value in one particular thread. I'll have to
mull that one over some more. It seems fundamentally different from
"scope locals", to the point of deserving a different way of interacting
with the feature (perhaps more closely tied to the concurrency model
than to variable storage).
- We keep adding hacks to get around the fact that Parrot doesn't
handle scopes smaller than a compilation unit particularly well. If we
tackled that quirk, dynamic binding would likely fall out more
naturally, not to mention exception handlers, lexical variables, etc.
Allison