Cross-posted to p6l and cardinal. Parrot Intermediate Compiler (or Intermediate Representation)
See parrot/languages/imcc Just another round of commits, supporting more directives and instructions. Correctly handling indexed use of strings ala: str[0] = "A" ch = str[0] Will have this working for the rest of the types soon, and still nudging Dan to allow keyed access with the Ix registers. Also added saveall/restoreall for easy subroutine writing until the compiler is smart enough to detect register usage and take care of it itself. Added the concat operator '.' for strings only, so as not to be confused with '+' $S1 = "Foo" . $S2 Finally added 'new' and 'end' end will now be implicitly inserted after the call to the first routine (lacking a .start directive), so you should put your main routine first. Fixed a couple of bugs in the register allocator to not graph color identifiers that were never used. Updated sample.imc. Did I mention its easier to write in IR than Parrot? :) -Melvin