develooper Front page | perl.perl5.porters | Postings from January 2012

Re: whither study()?

Thread Previous | Thread Next
January 30, 2012 15:31
Re: whither study()?
Message ID:
On 31 January 2012 00:19, Ricardo Signes <> wrote:
> * demerphq <> [2012-01-29T04:41:33]
>> Is it really in Perls interest that I, or anyone else with the chops,
>> even looks at fixing the bugs related to it? Can we just no-op and
>> deprecate it?
> A few years ago, I casually proposed deprecating it.  This was on IRC or at a
> conference or something.  A few people objected that it was actually useful, at
> least sometimes, so I know it's being used.


> Is it being used to any effect, in most cases?  Is it introducing problems?
> Are the breakages that it introduces the only thing keeping code working, now?
> Hoo boy!
> If it really is as broken as you say -- and I have no reason (or desire!) to
> doubt you -- then it does seem worth doing something about.

We /do/ test it, yet it is broken in some subtle ways, and maybe
worse, its is hard to tell. But it definitely complicates the goo
around the regex engine.

> Do we really want to deprecate it?  Some day, maybe we will want to add this
> feature back, and someone will have the energy to write a useful implementation
> and test suite.  Unlike many features, where there's some design gain to be
> made by ditching it, study isn't a wart.  It's just a once implemented and now
> pretty busted thing that might be useful again someday.

Ah I totally agree. I had "no op" in my head much stronger than
"deprecate". Lets no-op it, and see if anybody files a ticket
reporting a slowdown. No ticket, no problem. :-) I wonder if we will
get "bug" reports about peoples patterns starting to match correctly?

> The promise of study is that everything will work the same, with some shift in
> where cost is.  What if study became a nop?

Totally agree. It *should* be a noop. Then if we ever do have a use
for it we can just un-no-op it. (heh)

> We could issue a "useless use of study" but do we really need a warning?  The
> change would be "fixed a bug where study caused regex matches to behave
> incorrectly," and the performance hit would be like any other disabled bad
> optimization.

IMO it shoudn't warn.  I take back the deprecation part. Pure no-op is
just fine.

>What do we know about how much real effect this would be likely
> to have?

This is what I really want to know too.

>> Does anybody have any examples where it actually makes a difference?
> I second that question, but I only care if the difference is the kind of thing
> we want to keep around. ;)

I care both ways. If it is consistently slower these days then I would
have a much better case of no-oping it :-)


perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About