On Mon, May 26, 2014 at 2:53 AM, John Cowan <xxxxxx@mercury.ccil.org> wrote:
I still don't like the strong wording against backreferences; I think it should say
"beware, these are expensive, use only if needed" rather than "avoid
at all costs".  The latter expression raises the question "If they
should be avoided, why are they here at all?"

You're just repeating your previous argument here, so I'll
repeat my response.

They're here for backwards-compatibility, and to avoid future
forking in case people want to use them regardless of performance.
If you really know what you're doing (and what the underlying
backtracking implementation is doing), then there are uses of
backreferences that incur only a high polynomial cost.  Plus
there are games you can play like matching prime numbers
in Perl which can be amusing even if slow.

That said, the general case degenerates to exponential
backtracking, which in my book warrants as strong a warning
as I can make, waving red flags, caution: land mines, there
be dragons here, abandon all hope ye who enter here,
keep away from children, pregnant women, and drunken
machinery.

-- 
Alex