Klaas-Jan Stol wrote:

1. line 96 talks about the data types "int", "string", "pmc" and "float". [...] Wasn't the word "num" standard?

Yup, good catch. Probably crept in during the original edit down to just 4 types from the earlier long list.

2.a line 246, about .globalconstant, doesn't specify when the global is initialized. Is that when the sub in which it is declared is executed/compiled/loaded? Or at startup? 2.b is the ".constant" directive from pasm mode (which is in the macro layer) removed? This implies that this is no longer possible:
.constant hi "Hello World"
.sub main
  say .hi # the parser sees "Hello World"
.end

This isn't going away, and will be allowed in PIR.

I'm inclined to say that PIR's old '.const' should change to

  .local <type> <name> :constant

and that '.globalconst' can simply be deprecated. (It's only used in the repository for string and int constants, which would be cheaper as a macro-style substitution anyway.)

3. line 329. It doesn't say anything about quoted names, does this imply they are removed? So, writing ".sub 'new' " is no longer allowed? I also saw that local identifiers can be names of parrot ops. Then, the same would be true I assume for .params/.lexicals? And possibly sub-names and labels (as sub-names are just labels)?

Comment on quoted sub names added. Sub names aren't just labels, they're also stored in the namespace. Labels are still required to conform to the standard for Parrot identifiers.

4. line 384. The flag :named() is missing (in several places). Is this a mistake?

Added. (Probably need to make a full consistency pass between pdd03 and the PIR PDD.)

5. line 491. If "branch <label>" is covered by a "goto <label>" statement, and "goto" is considered more "human readable", why don't we rename the "branch" op to "goto"? In that case, it's 1 less thing to "map" from PIR to PASM and the PASM becomes more human readable too.

At the PASM level (a plain English translation of the bytecode), 'branch' makes sense, as it's paired with 'jump'. A branch goes to an offset from the current instruction, while a jump goes to a fixed address.

At the PIR level 'goto' is an abstraction that currently happens to directly map to 'branch'. It won't necessarily always be a direct mapping. In fact, branch points are prime candidates for optimizations (inlining, etc), so it's highly likely that 'goto' won't always be a direct mapping to 'branch'.

Allison

Reply via email to