The END block in Test.pm now runs correctly, and the entire module has been compiled to Parrot:
$ ./pugs -BPIR ext/Test/lib/Test.pm 1..0
As seen on #perl6:
* putter pictures trying to explain to someone, yes, it said "1..0", so we were quite happy...
With this, the zeroth phase -- that is, the sanity phase -- of PugsAST/PIR bootstrapping is done. Note that it currently passes none of the other 7000 tests; it's just sanity, and nothing more.
We also implemented these features on the PIR backend:
sub foo ($x, ?$y=$x) {say "$x = $y"}
say %*ENV<USER>
&::("say").("Hello!")
Even when unoptimised, the PIR backend is already nearly an order of magnitude faster than Pugs's main Eval runloop. However, because of Parrot's current heavy penalty against snapshotting a continuation, we're still much slower than Perl 5 for common control structures, especially with large number of loop iterations. Let's hope Leo's O(1) CPS fix will land soon...
There are lots of things left to do before we can run our own harness in PIR, mostly at the Parrot side:
require
and use
needs to be redispatched to Parrot.
With the current level of PIR support in 6.2.8, I think our YAPC::NA Hackathon can devote some time into bringing the primitives into shape; then we can subject PugsAST/PIR/Parrot to our existing 7000+ tests, and see if there are any serious glitches left to be found.
But, sleep first. See you tomorrow!