Which Perl 5 OO extension can be seen as "standard" (defacto, quasi)?

Discussion in 'Perl Misc' started by Ilias Lazaridis, Jun 15, 2007.

  1. I like the very fundamental OO support of Perl 5.

    constructs like "separated data/method inheritance", AUTOLOAD, give me
    the freedom to implement things as I like: very generic, general and
    dynamic.

    But as I don't like to "develope away from standard ways to do
    things", I've tried to find out which is the OO extension to use with
    perl 5.

    I've found this very compact one:

    http://www.netalive.org/swsu/archives/2004/09/reformed_perl_t.html

    but have immediately the problem that "self" is used instead of
    "$self" and that it seems that the code adds overhead at execution
    time.

    Then I've seen Perl6::Bundle which bring Perl 6 stuff to Perl 5

    http://www.linux-magazine.com/issue/49/Perl_6_Preview.pdf

    but I don't know two things:

    * how stable are those implementations?
    * how many perl developer do actually use them?
    * can I pick just the OO stuff out of the bundle, or are ther
    dependencies?
    * Is there any document which suggests which modules to use for new
    projects?

    Any suggestions / comments are welcome.

    I summarize all results herein:

    http://dev.lazaridis.com/lang/wiki/PerlOO

    ..

    --
    http://dev.lazaridis.com/lang/ticket/2
     
    Ilias Lazaridis, Jun 15, 2007
    #1
    1. Advertising

  2. On Fri, 15 Jun 2007 09:56:33 -0700, Jim Gibson
    <> wrote:

    >> I like the very fundamental OO support of Perl 5.

    >
    >OO support was added in Perl 5. It didn't exist in Perl 4. That is not
    >my definition of "fundamental". Perhaps you mean "primitive" :)


    Yes I think so. In Italian too "fondamentale" can have an acceptation
    akin to that one, and a naive translation may be the source for
    possible confusion, albeit less so than with other words.

    >> * how stable are those implementations?

    >
    >The reform.pm module looks very stable. It was uploaded to CPAN in Sep,
    >2004 and not updated since.


    Or obsolete... (I don't actually know, but that's possible!)


    Michele
    --
    {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
    (($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
    ..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
    256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
     
    Michele Dondi, Jun 16, 2007
    #2
    1. Advertising

  3. On Jun 15, 7:56 pm, Jim Gibson <> wrote:
    > In article <>,
    >
    > Ilias Lazaridis <> wrote:
    > > I like the very fundamental OO support of Perl 5.

    >
    > OO support was added in Perl 5. It didn't exist in Perl 4. That is not
    > my definition of "fundamental". Perhaps you mean "primitive" :)


    No, I meant: it gives me the fundament, on which I can build upon
    nicely.

    I don't feel it gives me a "basic" or a "primitive' OO support (as I
    can
    use the fundament to build upon)

    > > constructs like "separated data/method inheritance", AUTOLOAD, give me
    > > the freedom to implement things as I like: very generic, general and
    > > dynamic.

    >
    > > But as I don't like to "develope away from standard ways to do
    > > things", I've tried to find out which is the OO extension to use with
    > > perl 5.

    >
    > You don't need an "OO extension" to do OO programming in Perl. It is
    > now built into the language.

    [...]

    of course.

    My remarks above subject the build in-support.


    [...]
    > > * how stable are those implementations?

    [...]
    > > * how many perl developer do actually use them?

    [...]
    > > * can I pick just the OO stuff out of the bundle, or are ther
    > > dependencies?

    [...]
    > > * Is there any document which suggests which modules to use for new
    > > projects?

    [...]
    > > Any suggestions / comments are welcome.

    >
    > I think using any extensions to the language is generally a mistake

    [...] - (friendly suggestions and comments, mainly targetting language
    beginners)

    I summarize from your writings, the there is no OO extension available
    which could be seen as a standard.

    The build-in OO support of Perl5 is the today's standard.

    That's fine for me personally (I alreay enjoy the freedom).

    Is there possibly an community agreement on a standard accessor-
    extension (e.g. "
    if you have to use automated accessor generation, use CPAN::???)

    ..

    --
    http://dev.lazaridis.com/lang/ticket/2
     
    Ilias Lazaridis, Jun 16, 2007
    #3
  4. Le Sat, 16 Jun 2007 22:30:09 +0000, Ilias Lazaridis a écrit :

    >
    > Is there possibly an community agreement on a standard accessor- extension
    > (e.g. "
    > if you have to use automated accessor generation, use CPAN::???)


    I don't know for the accessors specifically, but Moose really blows
    everything else away IMHO.

    --
    "Dope will get you through times of no money better
    than money will get you through times of no dope."
    Freewheelin' Franklin.
     
    Emmanuel Florac, Jun 17, 2007
    #4
  5. On Sat, 16 Jun 2007 22:30:09 -0000, Ilias Lazaridis
    <> wrote:

    >I don't feel it gives me a "basic" or a "primitive' OO support (as I
    >can
    >use the fundament to build upon)


    But it *is* primitive, exactly because of that: but then do not
    misunderstand me, I've always been fascinated by the far reaching
    consequences of such a simple model. However many feel, and rightly
    so, that a more robust, pervasive OO model out of the box in which one
    is not forced to build stuff that is also available out of the box in
    other languages would be desirable: indeed that's why it's beeing
    added to Perl 6.

    >I summarize from your writings, the there is no OO extension available
    >which could be seen as a standard.
    >
    >The build-in OO support of Perl5 is the today's standard.


    Yes, it is *the* one and only standard. All of the available modules
    which give you bells and whistles build upon that. Talking about them,
    anyway... how 'bout Moose?!? (It is not meant as Perl-6-OO-model in
    Perl 5 but borrows heavily from the former.)

    >That's fine for me personally (I alreay enjoy the freedom).


    Freedom is fine and all, but don't exaggerate. We recommand daily to
    restrict one's own freedom in a useful manner that will help one to
    prevent making common programming errors, by using strict and
    warnings: with OO programming the situation is different and for the
    few things I've ever really needed in that field I also followed the
    DIY way, but... well, as a principle a better world should be
    possible! ;-)


    Michele
    --
    {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
    (($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
    ..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
    256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
     
    Michele Dondi, Jun 17, 2007
    #5
  6. On Jun 17, 11:21 pm, Michele Dondi <> wrote:
    > On Sat, 16 Jun 2007 22:30:09 -0000, Ilias Lazaridis
    >
    > <> wrote:
    > >I don't feel it gives me a "basic" or a "primitive' OO support (as I

    [...] - (primitive etc.)

    > >I summarize from your writings, the there is no OO extension available
    > >which could be seen as a standard.

    >
    > >The build-in OO support of Perl5 is the today's standard.

    >
    > Yes, it is *the* one and only standard.


    ok

    > All of the available modules
    > which give you bells and whistles build upon that. Talking about them,
    > anyway... how 'bout Moose?!? (It is not meant as Perl-6-OO-model in
    > Perl 5 but borrows heavily from the former.)


    "Moose Perl 6 OO in Perl 5"
    http://svn.pugscode.org/pugs/v6/docs/kp6-Notes.txt

    > >That's fine for me personally (I alreay enjoy the freedom).

    > Freedom is fine and all, but don't exaggerate. We recommand daily to

    [...]
     
    Ilias Lazaridis, Jun 18, 2007
    #6
  7. On Jun 17, 5:54 pm, Emmanuel Florac <> wrote:
    > Le Sat, 16 Jun 2007 22:30:09 +0000, Ilias Lazaridis a écrit :
    >
    > > Is there possibly an community agreement on a standard accessor- extension
    > > (e.g. "
    > > if you have to use automated accessor generation, use CPAN::???)

    >
    > I don't know for the accessors specifically, but Moose really blows
    > everything else away IMHO.


    * http://search.cpan.org/~stevan/Moose/
    * http://search.cpan.org/~stevan/Class-MOP/ Class::MOP

    I dislike the verbosity:

    has 'x' => (is => 'rw', isa => 'Int');
    has 'y' => (is => 'rw', isa => 'Int');

    sub clear {
    my $self = shift;
    $self->x(0);
    $self->y(0);
    }

    But the main question is again:

    * how is the adoption of MOP/MOOSE?
    * how much are the efforts synchronized with the original perl 6 OO
    implementation?

    ..

    --
    http://dev.lazaridis.com/lang/ticket/2
     
    Ilias Lazaridis, Jun 18, 2007
    #7
  8. Ilias Lazaridis

    Ch Lamprecht Guest

    Re: Which Perl 5 OO extension can be seen as "standard" (defacto,quasi)?

    Ilias Lazaridis wrote:

    > I dislike the verbosity:
    >
    > has 'x' => (is => 'rw', isa => 'Int');
    > has 'y' => (is => 'rw', isa => 'Int');

    You don't need the type constraint here:
    has 'x' => (is=>'rw');
    has 'y' => (is=>'rw');
    If that's still too verbose for you you could wrap &has and make (is=>'rw') default.
    >
    > sub clear {
    > my $self = shift;
    > $self->x(0);
    > $self->y(0);
    > }
    >




    --
    use Tk;use Tk::GraphItems;$c=tkinit->Canvas->pack;push@i,Tk::GraphItems->
    TextBox(text=>$_,canvas=>$c,x=>$x+=70,y=>100)for(Just=>another=>Perl=>Hacker);
    Tk::GraphItems->Connector(source=>$i[$_],target=>$i[$_+1])for(0..2);
    $c->repeat(30,sub{$_->move(0,4*cos($d+=3.16))for(@i)});MainLoop
     
    Ch Lamprecht, Jun 19, 2007
    #8
  9. Ch Lamprecht :
    > Ilias Lazaridis wrote:
    >
    > > I dislike the verbosity:
    > >
    > > has 'x' => (is => 'rw', isa => 'Int');
    > > has 'y' => (is => 'rw', isa => 'Int');

    > You don't need the type constraint here:
    > has 'x' => (is=>'rw');
    > has 'y' => (is=>'rw');
    > If that's still too verbose for you you could wrap &has and make (is=>'rw') default.


    ok, like this:

    hasInt 'x';
    has_int 'x';

    but most possibly there's a even more elegant way to provide the
    default value.

    thank's for the clarification.

    ..

    --
    http://dev.lazaridis.com/lang/ticket/2
     
    Ilias Lazaridis, Jun 21, 2007
    #9
  10. On Mon, 18 Jun 2007 08:06:25 -0700, Ilias Lazaridis
    <> wrote:

    >"Moose Perl 6 OO in Perl 5"
    >http://svn.pugscode.org/pugs/v6/docs/kp6-Notes.txt


    Anyway, from
    <http://search.cpan.org/~groditi/Moose-0.23/lib/Moose.pm>:

    : Is Moose just Perl 6 in Perl 5?
    :
    : No. While Moose is very much inspired by Perl 6, it is not itself Perl
    : 6. Instead, it is an OO system for Perl 5. I built Moose because I was
    : tired of writing the same old boring Perl 5 OO code, and drooling over
    : Perl 6 OO. So instead of switching to Ruby, I wrote Moose :)


    Michele
    --
    {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
    (($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
    ..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
    256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
     
    Michele Dondi, Jun 23, 2007
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ole Nielsby
    Replies:
    11
    Views:
    561
    James Kanze
    Nov 8, 2007
  2. user923005

    Re: Defacto standard string library

    user923005, Dec 29, 2008, in forum: C Programming
    Replies:
    3
    Views:
    268
    user923005
    Dec 29, 2008
  3. Stephen Sprunk

    Re: Defacto standard string library

    Stephen Sprunk, Dec 30, 2008, in forum: C Programming
    Replies:
    6
    Views:
    299
    Keith Thompson
    Jan 2, 2009
  4. Phil Carmody

    Re: Defacto standard string library

    Phil Carmody, Jan 1, 2009, in forum: C Programming
    Replies:
    59
    Views:
    1,145
    Richard Tobin
    Jan 5, 2009
  5. Dr J R Stockton

    JScript: - SEAKFYLE - 32-bit quasi-HUNT, quasi-DIR

    Dr J R Stockton, Dec 17, 2011, in forum: Javascript
    Replies:
    1
    Views:
    565
    Dr J R Stockton
    Dec 19, 2011
Loading...

Share This Page