Chip Salzenberg wrote:

Well, I see a lot to like about this, but (and you knew there was a "but"
("but" that's my job now :-))), in descending order of difficulty:

And you do it so well. Thank you. :)

 * The division into two categories ("global" and "symbol") leaves the third
   category (current namespace) with no clear home.

Agreed.

 * All the things being accessed are globals.  Seems like the word "global"
   should be used consistently, and "symbol" has many meanings in Parrot
   that only partly overlap the specific meaning of "global".

Agreed.

 * We still don't have way to ask for "my HLL" without spelling it.  I can
   say "my HLL's Foo" without spelling my HLL, but when I go up to my HLL's
   root I must suddenly know the spelling of my HLL and say it.  Seems like
   a sign of a design problem.

Agreed.

 * The global root is available as C<interpinfo .INTERPINFO_ROOT_NAMESPACE>
   at present -- awkward but fast.  Since global root accesses are supposed
   to be rare, awkwardness doesn't bug me for that case.  But adding opcodes
   for absolute-root ... hey, "absolute", that's a good name.
* Huffmanizing shouldn't be as big a consideration with PIR/pasm as with
   most languages.  Most PIR/pasm is program-generated.

Agreed, with a note of balance that we also want to avoid the pain of XS. Sometimes you need to poke into the guts of the system, and when you do, you want it to be pleasant to work with, even though it's not fancy.

So here's an illustrative suggestion, which I think is a variant on one of
your also-rans, albeit one that leaves the common HLL case unmarked:

      .HLL 'perl5', perl5_group
      .namespace ['Foo']

      $P0 = get_cur_global 'x'              # ['perl5';'Foo';'x']
      $P0 = get_cur_global ['Bar'], 'x'     # ['perl5';'Foo';'Bar';'x']

      $P0 = get_global 'x'                  # ['perl5';'x']
      $P0 = get_global ['Corge'], 'x'       # ['perl5';'Corge';'x']

      $P0 = get_abs_global 'x'              # ['x']
      $P0 = get_abs_global ['parrot'], 'x'  # ['parrot';'x']

This is non-evil. :)

I would rename 'get_cur_global' to 'get_global'. The selected namespace indicates that most of the code belongs in that namespace, so it's likely that most of the variables do too. (There are variations, but that's at least the common case.)

Then, what to call the HLL root access opcodes... perhaps 'get_rel_global' (for relative root)?

Allison

Reply via email to