in reply to Re^10: The future of Perl?
in thread The future of Perl?

Your counter examples are spot on and if stevan couldn’t convince you Moose is a good tool there is no way I ever could. :P

You're right. I wrote what is inside the spoiler tags before I thought again about that statement and you're right, I'm arguing with the wrong man. You've been polite and generous enough to conduct a discussion with me -- which is most appreciated -- so, please feel free not to look inside the spoiler. And if you do peek inside, do not feel obliged to respond :)


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^12: The future of Perl?
by salva (Canon) on Dec 15, 2014 at 10:09 UTC
    I agree with you almost completely.

    Though, I see an advantage in having a MOP and it is that you can mix extensions working at the meta-object level in a sane way. For instance, in bare Perl, it is quite easy to write a class that uses AUTLOAD to create methods on demand, but then, if you try to use again AUTOLOAD in a subclass, everything becomes a mess. Having a protocol eliminates that kind of problems. Cooperating becomes easy... and before you say it, yes, I agree, there are very few cases in practice where this is a real issue! but having a common language is also a good thing, otherwise you end writing your own ad-hoc mini-meta-protocols.

    The main problem I see in Moose is actually not in Moose per se but in so many programmers using it wrongly. Abusing it. Creating overcomplicated inheritance/roles structures. Adding abstraction layers where they are not required. Type-checking everything... it reminds me of the first days of the web when people felt obliged to use all the HTML tags in every page.

    Then there is the performance issue: the high setup time which breaks the you-pay-for-what-you-use principle that any good MOP should honor. For comparison, in Common Lisp/CLOS (which is at least as feature rich as Moose), defining a class that does nothing requires virtually no time:

    $ echo "(defclass foo () ())" | time sbcl This is SBCL 1.2.3.debian, an implementation of ANSI Common Lisp. ... * #<STANDARD-CLASS FOO> * 0.00user 0.00system 0:00.00elapsed 140%CPU (0avgtext+0avgdata 32360m +axresident)k 0inputs+0outputs (0major+901minor)pagefaults 0swaps
    While in perl, just loading Moose is on the order of the thens of a second:
    $ echo "package Foo; use Moose;" | time perl 0.13user 0.00system 0:00.13elapsed 100%CPU (0avgtext+0avgdata 19492max +resident)k 0inputs+0outputs (0major+3909minor)pagefaults 0swaps

      Nice points. Mouse is fast to start, faster when running, and does almost everything Moose does so it’s maybe a better choice if start up and ongoing speed matters; and start up speed often doesn’t matter: a lot of the code running out there is either persistent or automated so no user has to suffer the half second of hesitation.