Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re^2: new features in perl5 - who needs it?

by dk (Chaplain)
on Feb 23, 2009 at 12:11 UTC ( #745757=note: print w/replies, xml ) Need Help??

in reply to Re: new features in perl5 - who needs it?
in thread new features in perl5 - who needs it?

You're right, there ARE people developing interesting things, and that's why I'm in doubt. OTOH I don't know what motivation was for the person who did the great job of adding the MRO stuff. I also missed discussions about it, so I don't know if it was a feature generally found useful, or just a lone cowboy effort.
  • Comment on Re^2: new features in perl5 - who needs it?

Replies are listed 'Best First'.
Re^3: new features in perl5 - who needs it?
by stvn (Monsignor) on Feb 24, 2009 at 01:07 UTC
    I don't know if it was a feature generally found useful, or just a lone cowboy effort.

    The reason (as best I know) was that DBIx::Class was using the Class::C3 module, which I wrote the first version of as a sorta-kinda-joke-maybe-not, but Matt Trout (author of DBIx::Class) decide was really useful for keeping his Multiple-Inheritance hierarchy sane. My version was quite slow and basically a naive poor quality port of a Python version until Brandon took it over and promptly re-wrote it faster and eventually in XS. From there (I assume, cause I wasn't heavily involved) he petitioned p5p wrote tests and patches and got them to accept core changes that would make it possible for Perl to support the C3 MRO natively.

    So basically, no it wasn't lone-wolf-hey-this-is-neat-lets-add-it, it was backed by a serious need in a major module that had lots of community support behind it, and it was something that was not easily and cleanly accomplished outside of the core.

    As for the patch you have described, I would say that it is better as a module then a core addition. The reason being is that I can very easily see it causing issues with existing code (DarkPAN as they call it). I know I am guilty of occasionally using an imported function as a method (mostly just abusing Scalar::Util::blessed so that $obj->blessed returns the class it is blessed into) and I am sure many others are too. As for adding methods to a random SV, this is a major language feature and while cool probably breaks the well established package<->class relationship.

      Stevan, thanks you! - that'll give me something to think about. I was unwilling to changes the existing imported function behavior from the very beginning, but now I see that implications are even larger than I thought.
Re^3: new features in perl5 - who needs it?
by grinder (Bishop) on Feb 24, 2009 at 00:12 UTC

    It was basically Brandon Black bitching about how trying to change MRO (method resolution order) in Perl 5 was a pain and could someone do something about it. I recall the reason being that it was a biggest cause of slowdowns in Moose. Nicholas Clark dared him to write a patch, which he did. The rest, as they say, is history.

    So sort of both, really :)

    • another intruder with the mooring in the heart of the Perl

      Actually it wasn't Moose, but DBIx::Class where it was causing the issue (via the Class::C3 module). Moose didn't get support for C3 MRO until much later.

      But either way, Brandon++


Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://745757]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2021-11-28 01:55 GMT
Find Nodes?
    Voting Booth?

    No recent polls found