Planet Moose - August 2013

Welcome to the first edition of Planet Moose, a brief write up on what's been happening in the world of Moose this month, for the benefit of those of you who don't have their eyes permanently glued to the #moose IRC channel, or the MetaCPAN recent uploads page. The intention is to cover Moose and similar OO frameworks (Mouse, Moo, p5-mop), along with interesting developments to their dependencies and dependent projects.

This edition is a little sparse because it just contains the news that I happen to have noticed. If you have any items you'd like to be included in the September issue, add them to the wiki! That way it might not be so tobyink-focussed next month.

Moose 2.1005

No groundbreaking changes in this release: a couple of small bug fixes, plus Class::MOP::Mixin::HasMethods — and things that inherit from it, such as Moose::Meta::Class — now accept blessed coderefs being passed to the add_method method.

Lvalue Attributes

Christopher Brown has allowed me to adopt MooseX::Meta::Attribute::Lvalue which, after some rewriting, I've recycled into MooseX::LvalueAttribute. This pilfers some ideas from Damien Krotkine's MooX::LvalueAttribute module (which has incidentally seen a few updates recently too), and should now work properly with attributes that have type constraints, coercions, triggers, lazy builders, etc.

Class::Tiny

David Golden's Class::Tiny is a potential candidate for placing before Moo in the OO framework weight line-up. It gives you read-write accessors, a constructor, BUILD/DEMOLISH methods and precious little else. Throw in parent for inheritance and Role::Tiny for roles, and you've got a good Moose substitute for projects where your OO needs are very simple.

I've also released Class::Tiny::Antlers which provides basic implementations of Moose-like has, extends and with functions for Class::Tiny.

Moops

I've released Moops, which is syntactic sugar for building Moo, Mouse and Moose classes and roles. Its syntax is inspired by MooseX::Declare and p5-mop.

    class Fooooo extends Foo with Bar, Baz {
       method do_something (Int $i = 42) { ... }
    }

p5-mop

There has been lots of activity on p5-mop this month; some of it thanks to moving the parsing side of it off Devel::Declare and on to Jesse Luehrs' shiny new Parse::Keyword; and some as a result of Stevan Little trying to document (and therefore think about) how to port Moose code to p5-mop.

One visible change is to make class and role naming follow the same logic as sub (which Moops also does); where, for example:

   package Foo;
   sub xxx { }       # Foo::xxx
   sub yyy::zzz { }  # yyy::zzz; not Foo::yyy::zzz.

Stevan has blogged about some of the other features Jesse has been working on recently.

Florian Ragwitz has been working on a module for parsing Perl-6-like twigils (e.g. $!foo or $.bar) in Perl 5 code. It's not decided whether these will be used by p5-mop, but it's always good to have options.

In other news

  • Perl 5.18.1 and 5.19.3 were released during August. Moose seems to work fine on both of them.
  • Test::Class::Moose now has a tutorial.
  • Bread::Board has seen three new releases after almost two years of inactivity, with some bug fixes, documentation improvements and new features.
  • Type::Tiny 0.024 is out, offering better integration with MooseX::Types and MouseX::Types type constraint libraries.
  • I've released Sub::Block which is a wrapper for Sub::Quote (a module bundled with Moo), making it simple(ish) to create blocks of Perl code and combine them into subroutines.

3 Comments

Hey, thanks for this, lots of exciting stuff!
I don't hang out in #moose but I do use Moose and Moo on a daily basis and appreciate all the contributors hard work at making programming in perl better, cleaner, and more fun.

I like it! With all the activities in the Perl mop world, this is very useful! Thanks

oh no, not twigils! the name and the idea are both quite horrid.

Leave a comment

About Toby Inkster

user-pic I'm tobyink on CPAN, IRC and PerlMonks.