jump to navigation

Perl core, documentation and Moose (aka “can of worms”) March 5, 2011

Posted by claudio in Uncategorized.
Tags: , , ,

Creator of PerlIt seems I am not alone on the subject I raised in my New Years wishes (wishes, not demands). Good.

I wished –and still do today– that Perl releases would include Moose. I also wished for a tutorial/chapter on Object Oriented programming based on Moose for Perl newcomers. For this second wish I was specifically thinking on the upcoming release of O’Reilly’s “Learning Perl“. The nice authors answered  (see comments) and stated that they foresee the inclusion of a Moose chapter, but in the more advanced title “Intermediate Perl” instead.

On perl5-porters, the mailing list where Perl 5 development occurs, there is now a related discussion triggered by David Rolsky’s work on a new Object Oriented tutorial to be included in the Perl core documentation. It is certainly a welcome update to the present tutorial, but its use of Moose as a best practice seems to be rather polemic.

Tom Christiansen made a valid argument against a new core tutorial that included Moose:

Please don’t include anything in the standard distribution that tells people they can’t use the standard distribution.
If you want to include something in the standard distribution whose entire focus is outside the standard distribution, then you should bring the thing that is outside, inside.

Of course, this is an argument to keep references to non-core CPAN libraries out of the core documentation (isn’t CPAN not our biggest selling point?). It does not take a lot of imagination to turn the argument around and use it for the promotion of a modern Object Oriented framework to core. I am aware of the serious problem caused by the dependency chain of Moose, but it’s not that bad.

By talking with a lot of people at the Perl booth at FOSDEM I was positively surprised by the level of interest in (modern) Perl. Newbies seemed really curious and old perlers that long ago moved to other languages (“Were is Perl 6?”) were enthusiastic to give Perl a second chance. The Moose examples in chromatic’s“Modern Perl” book were a very convincing illustration of what Modern Perl was.

When (re-)introducing people to 2011′s Perl I don’t want to explain boilerplate that is difficult to grasp for new programmers (or myself ). Besides, people who are new to Perl are not necessarily new to programming and they are right not to be willing to put up with the overhead of plain OO Perl. The people I have encountered in this situation (or introduced myself to Perl) welcome –without exception– Moose as innovative and stylish (yes: the holy grail of readable code). In 2011 no one, except ironically the people writing Moose itself and “legacy programmers”, should be forced to write OO boilerplate code.

The people are there, the code is there, the momentum is there. Do we dare to take the chance?

(Picture by Dunechaser)

What I would love to see in 2011 for Perl January 1, 2011

Posted by claudio in Uncategorized.
Tags: , , , ,

2010 has been a great year for Perl. The community is vibrant and enthusiastic. The Modern Perl wave was not a hype and it is still going strong. Everyone seems to really agree on this. Eweek does even put Perl on number 6 on the group of languages like Java, C, C++, C# and JavaScript  and before other popular dynamic languages like Python (9) and Ruby (10). (This without giving too much importance to popularity lists or feeling animosity towards other languages.)

Anyway, too much to mention in detail, but I’ll remember the first Rakudo Perl 6 implementation for end users (how much vaporware do have working implementations), the release of Perl 5.12 with real improvements and with a new regular release cycle, the 1.0 release of the Moose Object System and the widespread adoption in the Perl world, the fast pace of the development of the Padre IDE, the enthusiasm of Perl::Staff at FOSDEM and CEBITT, the 10.000.000th (!!!!!) test report on CPAN thanks to the CPAN Testers, perlbrew, cpanminus, the release of the book Effective Perl Programming (2nd ed.) and Modern Perl

Would asking more qualify as hubris? I have just a small suggestion and no idea of it would be realistic from a technical or commercial point of view:

  • The Perl OO system is a present from Python. It’s flexible, it works and it needs a lot of boilerplate.
    Without being a copy of Perl 6, though inspired by it, Moose is a well-thought, modern and rich Object system. I am realistic enough to understand that it won’t be part of Perl core, but it would be great candidate for a double life module (included in the Perl tar and available newer versions on CPAN). When needed or wished, one can always bless variables or use other CPAN modules for creating objects, but there would be a clear default way of doing it. Batteries included, one may say :) .
  • Now getting a little personal, a little request to Randal L. Schwartz, Tom Phoenix, brian d foy: Please add a simple OO chapter based on Moose to -hopefully upcoming- Learning Perl, 6th edition (this is the commercial part mentioned before).
    New Perl Hackers need to know what the preferred OO framework is on Modern Perl without resorting to Google. What better entry than that great book that helped a lot of us (including me) take our first steps in the world of Perl?

You never know… now is the time for wishes.

Update: Moose core-developer Stevan Little blogs about this post and brian’s comments beneath. I don’t know if chromatic’s post about “The Minimalist Object System and Your Lousy Axioms” is directly related to this or Stevan’s aforementioned clarification on the Moose ecosystem, but it’s certainly an interesting addition to the discussion.


Get every new post delivered to your Inbox.

Join 127 other followers