Sunday, May 20, 2012

Who is using Regexp::Grammars ?

I've been using Regexp::Grammars for a couple of projects and I find this module really amazing : so much power in such a compact form ! Actually, the whole thing is a gigantic hack, but an extremely clever hack. The learning curve is steep, but once you are used to it, playing with callback actions, grammar inheritance trees or fancy "result distillation" strategies is a joy. The only drawback is that running callback functions within the Perl regexp compiler is sometimes tricky (in Perl versions prior to 5.14, the regexp engine is not reentrant; and debugging may be acrobatic).

I just had a look at the reverse dependencies and was very surprised to find so few CPAN modules that depend on Regexp::Grammars, while its predecessor Parse::RecDescent has many more dependencies. So I'm wondering why Regexp::Grammars is not more widespread. Some guesses :
  • the learning curve
  • the dependency on perl 5.10 regexes
  • the regex engine reentrance problem mentioned above
Any other opinions ?