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
> 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.
This sounds like good news and excellent work by a lot of people,
but I'm a bit afraid to upgrade, having just started to learn to
work around PGE's idiosyncracies. Is it still possible to use PGE
for rules support? How is this controlled?
Also, I just noticed that there's a choice between embedding Parrot
and using Parrot externally (I presume the latter happens if I set
PARROT_PATH without PUGS_EMBED=parrot.) What functionality
do I lose without an embedded parrot? Why is an embedded Parrot
not recommended? Does PUGS_EMBED="parrot perl5" create
any sort of a conflict?
BTW, I'd appreciate more documentation on PUGS_EMBED and
the effect of the -B and -C switches in general, somewhere
along with README and INSTALL in the top-level directory.
I remember being surprised to learn from "pugs --help" that
Pugs, PIL2, and GHC were different backends, and I still don't
understand it. The documentation should be newer and more
user-oriented than STATUS, and contain references to which portions
of the source tree are involved when you choose a particular
set of options. README itself would be a good place for it.
sanug++'s pictures were beautiful (maybe too hard to update?),
but there's a bit of reality impedance, and a look at
Perl_6_on_Haskell_is_Pugs.jpg only strengthens my expectation
that the Pugs, PIL2, and GHC backends (maybe even PIL2-YAML)
should be the same.
Thanks!
Christopher