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 had 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 had been fighting
with the interoperability between these two animals to ensure they
play together. Everyone remembers that the parrot embedding was ever
something 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 already possible 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're having a simple Perl 6 compiler based on it, which
passes ~1000 tests in the Pugs test suite. So it's good enough. Now
you can try out Perl 6 regexes without parrot:

   pugs> 'abc' ~~ /\w+/
   Match.new(
     ok => Bool::True,
     from => 0,
     to => 3,
     str => "abc",
     sub_pos => (),
     sub_named => {}
   )

Audrey said 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. Thus
the long-standing message ``perl5 embedding is not available on
Win32'' while building pugs is finally gone! Yay!

Note that the PCR integration work is in progress, but we believe it's
a good start anyway. :D

P.S. This mail has also been posted on Audrey's blog site:

   http://pugs.blogs.com/pugs/2006/09/pcr_replaces_pg.html

Cheers,

Agent

Reply via email to