Tonight, Audrey implemented the bridge between Pugs' Haskell core and the Perl 5 module Pugs::Compiler::Rule, thus bringing rules support to our pugs ``for free''. This is really good news to us. :)
For more than one year, Pugs required parrot to provide full Perl 6 regexes (rules) support since Pugs didn't have its own grammar engine. In those early days, parrot's PGE (Parrot Grammar Engine) was the only choice.
However, obtaining and compiling parrot is a daunting task for most inexperienced users. And furthermore, the Pugs team has been struggling with the interoperability between these two ``animals'' to ensure they play together well. Everyone must still remember that parrot embedding was almost like a nightmare.
Hence it was hoped that pugs could get rid of the parrot dependency completely. With fglock's excellent work started from the beginning of this year, it is a reality today. Pugs::Compiler::Rule (PCR) is a pure Perl 5 implementation for Perl 6 regexes. Although there's still a lot of missing features in PCR (see its TODO file for details), we have already got a simple Perl 6 compiler based on PCR, which has passed ~1000 tests in the Pugs test suite. So it's good enough. And you can try out Perl 6 regexes without parrot anymore:
pugs> 'abc' ~~ /\w+/ Match.new( ok => Bool::True, from => 0, to => 3, str => "abc", sub_pos => (), sub_named => {} )
Audrey says it reuses the now-on-by-default perl 5 embedding feature of pugs. It also works for Windows users since I've helped her to solve the long-overdue p5 embedding problem on ActivePerl 5.8.x. And gone is the long-standing message ``perl5 embedding is not available on Win32'' while building Pugs. Yay!
Note that the PCR integration work is still under way, but we believe it's a good start anyway. :D
Update:
It is still undecided if Pugs should keep PGE as an alternative. I think leaving the choice to the user is more sensible. :)
btw, this journal was generated by a perl 5 script from an enhanced version of pod. enjoy~ :)
Posted by: Agent Zhang | 2006.09.17 at 02:03 AM
I appreciate having this choice. Last time I checked, the Parrot package for FreeBSD was broken, and I gave up trying to install it there.
Posted by: Mark Stosberg | 2006.09.17 at 07:37 AM