develooper Front page | perl.perl5.porters | Postings from March 2011

Re: What does this convey about Moose and CPAN? (Re: Revising Perl'sOO docs - a new OO tutorial)

Thread Previous | Thread Next
Reini Urban
March 6, 2011 06:11
Re: What does this convey about Moose and CPAN? (Re: Revising Perl'sOO docs - a new OO tutorial)
Message ID:
My argument against Moose is typically this:

Moose is good and nice and the only to be recommended OO framework for perl.
But it is immature and slow, partially because it still has no proper
perl core support.
You can compare it to the simple straightforward and simple PCL
implementation of CLOS,
which was used in the first 5 years of CLOS usage.
Anybody can write this, but nobody would recommend it.

It works, includes most of the needed features, but is not integrated
into core at all.
Modern CLOS frameworks which are commonly used are tightly integrated.
E.g. every variable has a class pointer (and not in the 2nd struct),
method lookups
are optimized beforehand, and much more. I'm not into that anymore.
We e.g. only have a stash (class) pointer, which is looked up by name
at run-time, not by ptr. This can be fixed.
Class traversal and name lookup is by name not by ptr, class hashes
are even not optimized. This can be fixed.
mro caches a bit.
Calling subs is painfully slow on perl, calling methods similar. This
cannot be fixed with our current layout.
We do not even optimize on subs/methods.

You can safely recommend the Moose API, because it is established and
is basically a CLOS port to perl.
But recommending Moose as *the* OO on perl is silly, and Moosifying
more on CPAN is even sillier, as silly
as using Module::Build now.

No, I don't want to optimize Moose (nor Module::Build).
I personally hate overblown OO at all, if it's CLOS or Moose.
If I would choose I would go with golang.

Replies here with fixed subject if one really has to:
And Module::Build should have first started with
getting the dependency chaining right, if your goal
is to write a make replacement.
Reini Urban

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