Today is the "Parrot is going to release tomorrow" day. The monthly release cycle is wonderful, as it ensures that the three Pugs/Parrot interops (embedding parrot, PGE rules, compiling to parrot) keeps working.
To that end, I fixed the Parrot codegen, removing deprecated opcodes and syntaxes. To my surprise and delight, I discovered that if I turn the parrotIsBrokenXXX flag to False, most tests in t/01-sanity/* still passes -- they used to break horribly, eaten alive by the rabid register alligator.
However, the new Parrot removed the ability to fake nested scopes with label-delimited inline closures, so some tests are now infinite-looping when compiled to Parrot. The correct (and easy) way to fix it would be using the new lexpad spec -- hopefully by Parrot 0.3.2 we will get both side implemented and work in harmony.
PGE got much more powerful with its ability to return anything, in addition to static Match objects. As a concrete demonstration, PGE now comes with a builtin p6rule
rule that parses a Perl 6 rule string into a PGE::Rule object -- which will automagically appear in Pugs's $/
as a hash object. To wit:
pugs> ('1' ~~ //) Match.new( ok => bool::true, from => 0, to => 1, str => "1", sub_pos => (), sub_named => { "expr" => Match.new( ok => bool::true, from => 0, to => 1, str => "1", sub_pos => (), sub_named => { "type" => "term:", "value" => "1" } ) } )
Of course, it works for arbitrarily complex rules, not just a single character literal.
Note that we can't yet call the returned object's methods in Pugs, and there's no way to define rules using Perl 6 methods. This is because Pugs/Parrot doesn't really have a OO message protocol between them, and there are several complementary ways to solve this:
On a completely unrelated note, gaal is writing an article for TPR (The Perl Review) about Pugs -- feel free to chime in! (As usual, ask for a committer bit on freenode #perl6 if you hadn't got one.)
Last week's Shibuya.pm meeting features Catalyst, Ajax, Pugs and ICFP. Takesako-san did a nice presentation (PPT in Japanese) about Pugs, though some slides leaves me feeling excessively flattered. ;-)
But now, happy in the knowledge that Parrot 0.3.0 can fly with Pugs interop intact, I'll go back to MM/PIL2 hacking ere sleep. See you tomorrow!