<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Call of the Moose</title>
    <link rel="alternate" type="text/html" href="http://blog.moose.perl.org/" />
    <link rel="self" type="application/atom+xml" href="http://blog.moose.perl.org/atom.xml" />
    <id>tag:blog.moose.perl.org,2010-07-21:/3</id>
    <updated>2011-12-15T19:34:16Z</updated>
    <subtitle>Moose announcements and writings</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.38</generator>

<entry>
    <title>We don&apos;t depend on 1/2 of CPAN, 1/2 of CPAN depends on us!</title>
    <link rel="alternate" type="text/html" href="http://blog.moose.perl.org/2011/12/we-dont-depend-on-12-of-cpan-12-of-cpan-depends-on-us.html" />
    <id>tag:blog.moose.perl.org,2011://3.199</id>

    <published>2011-12-15T19:10:28Z</published>
    <updated>2011-12-15T19:34:16Z</updated>

    <summary>Well, not really, but the new Map of CPAN website created by Grant McLean provides some pretty awesome (and quite telling) visualizations.Modules that Moose depends on.Modules that depend on Moose (give it a few seconds to load)....</summary>
    <author>
        <name>Stevan Little</name>
        
    </author>
    
    <category term="cpan" label="cpan" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="moose" label="moose" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="visualization" label="visualization" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.moose.perl.org/">
        <![CDATA[Well, not really, but the new <a href="http://mapofcpan.org/">Map of CPAN website</a> created by <a href="http://mapofcpan.org/#/maint/GRANTM">Grant McLean</a> provides some pretty awesome (and quite telling) visualizations.<div><br /></div><div><a href="http://mapofcpan.org/#/distro/Moose/deps">Modules that Moose depends on.</a></div><div><br /></div><div><a href="http://mapofcpan.org/#/distro/Moose/rdeps">Modules that depend on Moose</a> (give it a few seconds to load).</div><div><br /></div>]]>
        
    </content>
</entry>

<entry>
    <title>Moose 2.02</title>
    <link rel="alternate" type="text/html" href="http://blog.moose.perl.org/2011/06/moose-202.html" />
    <id>tag:blog.moose.perl.org,2011://3.184</id>

    <published>2011-06-19T01:12:05Z</published>
    <updated>2011-06-19T01:15:18Z</updated>

    <summary> It&apos;s almost July, which means that it&apos;s time to start looking at the next major release of Moose, 2.0200. In addition to the changes that have been released in the minor revisions of the 2.00 series, this release will...</summary>
    <author>
        <name>Jesse Luehrs</name>
        
    </author>
    
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.moose.perl.org/">
        <![CDATA[<p>
It's almost <a href="http://beta.metacpan.org/module/Moose::Manual::Support">July</a>, which means that it's time to start looking at the next major release of Moose, 2.0200. In addition to the changes that have been released in the minor revisions of the 2.00 series, this release will also include some additional, larger changes, the main ones being type constraint inlining and some changes to the way we generate inlined methods.
</p>

<h2>Type constraint inlining</h2>
<p>
When you define a type, you typically only specify how the type differs from some parent type. Currently, as a way to speed up type constraint checking, you can use the <tt>optimize_as</tt> option to define a validation subroutine to be used in place of checking the parent constraint followed by the current constraint's check. This helps, but could be better.
</p><p>
In 2.02, you will be able to use the <tt>inline_as</tt> option instead, to define a code snippet to use when inlining this type constraint, avoiding even the subroutine call overhead in accessors and constructors. Based on <a href="http://api.metacpan.org/source/DOY/Moose-2.0102-TRIAL/benchmarks/type_constraints2.pl">some simple benchmarks</a>, this speeds up accessors by 30-40% and constructors by 10-30%, depending on the type constraints used and what else the methods are doing:
</p><p>
<pre>
Moose 2.00
------
Benchmark: timing 500000 iterations of accessors_simple, constructor_simple...
accessors_simple:  4 wallclock secs ( 4.41 usr +  0.00 sys =  4.41 CPU) @ 113378.68/s (n=500000)
constructor_simple: 18 wallclock secs (17.83 usr +  0.01 sys = 17.84 CPU) @ 28026.91/s (n=500000)
Benchmark: timing 20000 iterations of accessors_all, constructor_all...
accessors_all: 12 wallclock secs (11.92 usr +  0.01 sys = 11.93 CPU) @ 1676.45/s (n=20000)
constructor_all: 12 wallclock secs (11.85 usr +  0.01 sys = 11.86 CPU) @ 1686.34/s (n=20000)

Moose 2.02
-----
Benchmark: timing 500000 iterations of accessors_simple, constructor_simple...
accessors_simple:  3 wallclock secs ( 2.70 usr +  0.01 sys =  2.71 CPU) @ 184501.85/s (n=500000)
constructor_simple: 15 wallclock secs (16.15 usr +  0.00 sys = 16.15 CPU) @ 30959.75/s (n=500000)
Benchmark: timing 20000 iterations of accessors_all, constructor_all...
accessors_all:  8 wallclock secs ( 7.45 usr +  0.01 sys =  7.46 CPU) @ 2680.97/s (n=20000)
constructor_all:  8 wallclock secs ( 7.73 usr +  0.01 sys =  7.74 CPU) @ 2583.98/s (n=20000)
</pre>
</p><p>
Because <tt>inline_as</tt> provides all of the functionality that <tt>optimize_as</tt> provided, <tt>optimize_as</tt> will be deprecated in 2.02, and eventually removed.
</p>

<h2>Method generation</h2>
<p>
Constructors and accessors are generated as closures. For instance, when you pass <tt>"default =&gt; sub { ... }"</tt> as an attribute option, that sub is saved, and then closed over when the accessor is generated (if the attribute is lazy), something along the lines of:
</p><p>
<pre>
my $default = $attr-&gt;default;
my $code = eval "sub { ... }"; # this uses $default
$meta-&gt;add_method($attr-&gt;name =&gt; $code);
</pre>
</p><p>
Previously, we used to close over a lot of meta-objects directly, out of convenience, but this makes deparsing hard because of the many links metaobjects have between each other (try using Data::Dump::Streamer to deparse a Moose-generated constructor!). More importantly though, this gets in the way of some future optimizations we're hoping to be able to do.
</p><p>
The actual effects of this are mostly only visible if you're writing extensions that require using the closed-over variables that were removed (<tt>$attr</tt>, <tt>$meta</tt>, <tt>$type_constraint_obj</tt>, etc). If you were, you'll have to either adjust your inlining code to use the new variables that are provided, or override the environment that Moose uses when compiling generated methods to add them back. Feel free to stop by #moose if you have questions about how to do this.
</p><p>
Finally, one obstacle to this being complete is that initializer subs receive the attribute metaobject as a parameter, which means we can't avoid closing over it in that case. This behavior is now deprecated, and will be removed in the future.
</p>

<h2>Other changes since 2.0008</h2>
<ul>
<li>The Array native trait now has a <tt>first_index</tt> delegation, which works just like <tt>first</tt> except that it returns the index of the match rather than the match itself.</li>
</ul>

<h2>Summary of changes during the 2.00 release cycle</h2>
<ul>
<li>Type constraint error messages now use Devel::PartialDump when possible, to display the data that failed the type constraint.</li>
<li>Anonymous packages are now possible, via <tt>Class::MOP::Package-&gt;create_anon</tt>.</li>
<li>The methods we generate are now much better about storing definition contexts, so there should be a lot fewer instances of "generated method (unknown origin)".</li>
<li>Many bug fixes (see the <a href="http://beta.metacpan.org/source/DOY/Moose-2.0008/Changes">Changes</a> file for a full list).</li>
</ul>

<h2>Conclusion</h2>
<p>
Please install the current release candidate (Moose 2.0102) from CPAN, and report any issues it causes with your code. If all goes well, Moose 2.0200 will be released on July 18.
</p>]]>
        
    </content>
</entry>

<entry>
    <title>Moose Class at YAPC::NA 2011</title>
    <link rel="alternate" type="text/html" href="http://blog.moose.perl.org/2011/05/moose-class-at-yapcna-2011.html" />
    <id>tag:blog.moose.perl.org,2011://3.181</id>

    <published>2011-05-27T14:50:56Z</published>
    <updated>2011-05-27T14:51:07Z</updated>

    <summary>I&apos;ll be offering a one day Intro to Moose class at YAPC::NA 2011 in lovely Asheville, NC. To register, log in to the YAPC::NA site and then go to purchasing page. If you haven&apos;t registered for YAPC yet, you can...</summary>
    <author>
        <name>Dave Rolsky</name>
        <uri>http://blog.urth.org/</uri>
    </author>
    
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.moose.perl.org/">
        <![CDATA[<p>I'll be offering a one day Intro to Moose class at <a href="http://www.yapc2011.us/yn2011/">YAPC::NA 2011</a> in lovely Asheville, NC. To register, log in to the YAPC::NA site and then go to <a href="http://www.yapc2011.us/yn2011/purchase">purchasing page</a>. If you haven't registered for YAPC yet, you can buy your conference ticket at the same time too.</p>

<h2>Intro to Moose</h2>

<p>Join us for an interactive hands-on course all about Moose, an OO system for Perl 5 that provides a simple declarative layer of "sugar" on top of a powerful, extensible meta-model.</p>

<p>With Moose, simple classes can be created without writing any subroutines, and complex classes can be simplified. Moose's features include a powerful attribute declaration system, type constraints and coercions, method modifiers ("before", "after", and "around"), a role system (like mixins on steroids), and more. Moose also has a vibrant ecosystem of extensions as seen in the variety of MooseX:: modules on CPAN.</p>

<p>This course will cover Moose's core features, dip a toe into the meta-model, and explore some of the more powerful MooseX:: modules available on CPAN.</p>

<p>Students are expected to bring a laptop, as you will be writing code during the class. You will also be provided with a tarball a week or so before the class is scheduled, which will contain a directory tree skeleton and test files. </p>
]]>
        

    </content>
</entry>

<entry>
    <title>Moose&apos;s Perl version support policy</title>
    <link rel="alternate" type="text/html" href="http://blog.moose.perl.org/2011/05/mooses-perl-version-support-policy.html" />
    <id>tag:blog.moose.perl.org,2011://3.178</id>

    <published>2011-05-17T18:30:10Z</published>
    <updated>2011-05-17T18:40:11Z</updated>

    <summary>The release of perl 5.14.0 (and the simultaneous dropping of support for the perl 5.10 release series) is probably a good time to start looking at the support policy for the future of Moose. In particular, we do not yet...</summary>
    <author>
        <name>Jesse Luehrs</name>
        
    </author>
    
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.moose.perl.org/">
        <![CDATA[The <a href="http://thread.gmane.org/gmane.comp.lang.perl.perl5.porters/94575">release of perl 5.14.0</a> (and the simultaneous dropping of support for the perl 5.10 release series) is probably a good time to start looking at the support policy for the future of Moose. In particular, we do not yet have an official policy for the versions of perl we support.<br /><br />For a historical perspective, Moose has required perl 5.8.1 since 2008 (at which point, 5.10.0 was the latest released version of perl). The requirement was bumped to 5.8.3 within the past year due to test failures on 5.8.1 (and none of the dev team having access to anything below 5.8.3), a move that met with basically no complaints.<br /><br />Today, the latest released version of perl is 5.14.0. Relatedly, the earliest version of perl still supported by the perl5-porters is 5.12.0, and the earliest version of perl shipped with the latest release of any major Linux distribution except CentOS is 5.10.1 (and CentOS 6 should be released with 5.10.1 <a href="http://qaweb.dev.centos.org/qa/calendar">by the beginning of June</a>). Supporting back to 5.8.3 now requires supporting 4 major releases (and 13 minor releases) dating back 7 years, and this isn't a very sustainable position to be in, given the limited resources of the Moose dev team. With new major releases of perl coming out yearly now, this will easily become overwhelming soon.<br /><br />So with that in mind, Moose will be dropping support for perl 5.8 with the 2.06 release (in January of 2012). This will allow enough time for CentOS to get a stable release out that contains perl 5.10.1, and so everyone still running perl 5.8 should have an officially supported upgrade path by that point. As for what this actually means: we will not be immediately rushing in to start using smart matching and ripping out our existing 5.8 compatibility code. The specified version requirement will stay at 5.8.3. Moose will likely continue to work on perl 5.8 for a good while after next January. What this does mean, however, is that we will not be spending any more time fixing 5.8-specific issues. If critical bugs are found (unlikely at this point, but still possible), we will likely just bump our version requirement if no patch is forthcoming. New features are a fuzzier topic, but if someone comes along and implements a new Moose feature that requires features in perl 5.10, that patch will likely be accepted.<br /><br />Our official support policy has been updated with this new information, and will be released with the next Moose release; it can be viewed <a href="https://github.com/moose/moose/blob/master/lib/Moose/Manual/Support.pod">here</a>. If you have any questions about this policy, feel free to stop by #moose on irc.perl.org or contact the Moose mailing list at moose@perl.org.<br /> ]]>
        
    </content>
</entry>

<entry>
    <title>Moose 2.0 Release Candidate</title>
    <link rel="alternate" type="text/html" href="http://blog.moose.perl.org/2011/04/moose-20-release-candidate.html" />
    <id>tag:blog.moose.perl.org,2011://3.173</id>

    <published>2011-04-05T05:55:29Z</published>
    <updated>2011-04-05T06:21:14Z</updated>

    <summary>As you may have noticed, there has been a bit of a delay in getting Moose 2 out. We&apos;ve been doing a lot of testing, and a lot of fixing up of the Moose extensions (and a lot of being...</summary>
    <author>
        <name>Jesse Luehrs</name>
        
    </author>
    
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.moose.perl.org/">
        <![CDATA[As you may have noticed, there has been a bit of a delay in getting Moose 2 out. We've been doing a lot of testing, and a lot of fixing up of the Moose extensions (and a lot of being busy with things other than Moose), but we're finally ready for a release. Moose-1.9906-TRIAL has just made it to CPAN, and this will hopefully be the last dev release before 2.0000. If you've been holding off on testing the new Moose versions until things settle down and everything works again, now is the time to actually do that. If no serious bugs are reported in the next week or so, Moose 2.0000 will be released on Monday, April 11.<br /><br />As mentioned earlier, this release includes some major refactorings of the internals. Therefore, a lot of MooseX modules had to be updated to take this into account. All of the latest versions of the MooseX modules should now work with both the current stable release, and the latest dev release of Moose, so you can upgrade all of these without any breakages.<br /><br />The inverse of this is not true, however - many old versions of Moose extensions will break if you upgrade Moose without also upgrading them. When you upgrade to Moose 1.9906 (or Moose 2.0000), the installation process will warn if there are any outdated modules installed on your system that may stop working with the new Moose. Upgrading these modules is important in order to make sure everything continues to work. To make this process easier, Moose now ships with a script named 'moose-outdated', which scans through your system and prints the names of any modules it finds which conflict with the currently installed version of Moose. After upgrading Moose, a simple 'moose-outdated | cpanm' should bring you up to date. This functionality will continue to be provided and kept up to date in future versions of Moose.<br /><br />Finally, I'd just like to highlight again the issue that Dave brought up in the previous post - make sure you aren't expecting role attributes to pick up the attribute metaclass of the class they're being applied to, as this will no longer happen. Read the previous post for more details about this.<br /><br />Comments, questions, or issues with the Moose release candidate should be directed to #moose on irc.perl.org, the moose@perl.org mailing list, or Moose's issue tracker on rt.perl.org.<br />]]>
        
    </content>
</entry>

<entry>
    <title>Changes to MooseX Modules with Moose 2.0</title>
    <link rel="alternate" type="text/html" href="http://blog.moose.perl.org/2011/03/changes-to-moosex-modules-with-moose-20.html" />
    <id>tag:blog.moose.perl.org,2011://3.170</id>

    <published>2011-03-29T20:07:18Z</published>
    <updated>2011-03-29T20:30:57Z</updated>

    <summary>We&apos;re getting closer and close to releasing Moose 2.0, and I wanted to highlight one particular change in Moose 2.0. MooseX modules whic affect attributes, like MooseX::SemiAffordanceAccessor and MooseX::LazyRequire, now have different behavior in conjunction with roles. When you use...</summary>
    <author>
        <name>Dave Rolsky</name>
        <uri>http://blog.urth.org/</uri>
    </author>
    
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.moose.perl.org/">
        <![CDATA[<p>We're getting closer and close to releasing Moose 2.0, and I wanted to
highlight one particular change in Moose 2.0.</p>

<p>MooseX modules whic affect attributes, like
<a href="http://search.cpan.org/dist/MooseX-SemiAffordanceAccessor">MooseX::SemiAffordanceAccessor</a>
and <a href="http://search.cpan.org/dist/MooseX-LazyRequire">MooseX::LazyRequire</a>, now
have different behavior in conjunction with roles.</p>

<p>When you use one of these modules in your class, it applies a trait to all of
the attributes defined in your class:</p>

<pre><code>package MyClass;

use Moose;
use MooseX::SemiAffordanceAccessor;

has foo =&gt; ( is =&gt; 'rw' );
</code></pre>

<p>In this example, the <code>foo</code> attribute ends up with the
<code>MooseX::SemiAffordanceAccessor::Role::Attribute</code> trait applied to it behind
the scenes. This trait is what affects how accessors are named.</p>

<p>With the current version of Moose, these attribute traits are <strong>also</strong> applied
to attributes provided by roles:</p>

<pre><code>package MyClass;

use Moose;
use MooseX::SemiAffordanceAccessor;

with 'MyRole';

has foo =&gt; ( is =&gt; 'rw' );
</code></pre>

<p>Any attributes provided by <code>MyRole</code> end up with the SemiAffordanceAccessor
naming scheme.</p>

<p>This is a huge stinking bug. The problem is that by applying this trait, we
have changed the interface provided by <code>MyRole</code>. One of the major uses of
roles is to provide a named interface, so this is bad.</p>

<p>With Moose 2.0, this bug is fixed. When we apply <code>MyRole</code>, the attributes
applied from the role no longer acquire the attribute traits of the consuming
class.</p>

<p>However, some people might have been taking advantage of this feature, writing
roles with the assumption that the consuming class uses a MooseX module.</p>

<p>The right thing to do is to use the relevant MooseX module <strong>in the role
itself</strong>. This is not possible with Moose 1.2x, but will be possible in Moose
2.0. The only catch is that the MooseX module has to explicitly support this.</p>

<p>For many modules, this is trivial. Let's take <code>MooseX::SemiAffordanceAccessor</code>
as an example. The code used to look like this:</p>

<pre><code>Moose::Exporter-&gt;setup_import_methods(
    class_metaroles =&gt; {
        attribute =&gt; ['MooseX::SemiAffordanceAccessor::Role::Attribute'],
    },
);
</code></pre>

<p>To make it work with both new and old Moose, it becomes:</p>

<pre><code>my %metaroles = (
    class_metaroles =&gt; {
        attribute =&gt; ['MooseX::SemiAffordanceAccessor::Role::Attribute'],
    },
);

$metaroles{role_metaroles} = {
    applied_attribute =&gt; ['MooseX::SemiAffordanceAccessor::Role::Attribute'],
} if $Moose::VERSION &gt;= 1.9900;

Moose::Exporter-&gt;setup_import_methods(%metaroles);
</code></pre>

<p>Some MooseX modules don't have it so easy. If your MooseX applies traits to
the class metaclass as well as the attributes, making it work with roles is
much harder. We're planning to make this simpler in Moose 2.02, but for now
your best bet is to look at a module like
<a href="http://search.cpan.org/dist/MooseX-Attribute-Deflator">MooseX::Attribute::Deflator</a>
for an example of how to do this. Basically, you have to have the role "pass
along" the class metaroles when the role is applied.</p>

<p>As a consumer of a MooseX module, updating to Moose 2.0 will be fairly
simple. If you want to apply a MooseX module to attributes in role, just use
the module in your roles.</p>

<p>We're currently working with MooseX authors to get their modules updated in
preparation for the Moose 2.0 release.</p>

<p>We're available on irc://irc.perl.org/#moose-dev to help you update your
module, or you can email us at moose@perl.org. Please contact us if you need
help updating your code.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>The Moose Ecosystem</title>
    <link rel="alternate" type="text/html" href="http://blog.moose.perl.org/2011/01/the-moose-ecosystem.html" />
    <id>tag:blog.moose.perl.org,2011://3.162</id>

    <published>2011-01-05T12:03:33Z</published>
    <updated>2011-01-05T14:26:18Z</updated>

    <summary>I was browsing Planet Perl Iron Man over the holidays and reading many of the &quot;Year in Perl&quot; recaps as well as the &quot;Perl in 2011&quot; predictions. One in particular caught my attention, that is What I would love to...</summary>
    <author>
        <name>Stevan Little</name>
        
    </author>
    
    <category term="moo" label="moo" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="moose" label="moose" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mouse" label="mouse" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.moose.perl.org/">
        <![CDATA[<p>I was browsing <a href="http://ironman.enlightenedperl.org/">Planet Perl Iron Man</a> over the holidays and reading many of the "Year in Perl" recaps as well as the "Perl in 2011" predictions. One in particular caught my attention, that is <a href="http://nxadm.wordpress.com/2011/01/01/what-i-would-love-to-see-in-2011-for-perl/">What I would love to see in 2011 for Perl</a> by <a href="http://nxadm.wordpress.com/about/">claudio</a> in which he has many nice words to say about <a href="http://moose.perl.org/">Moose</a> and the Modern Perl movement in general. As I started to read the comments I noticed one from <a href="http://nxadm.wordpress.com/2011/01/01/what-i-would-love-to-see-in-2011-for-perl/#comment-800">brian d foy</a> in which he said:</p>

<blockquote>
  <p>Note, though, that calling Moose "the preferred OO framework" is a bit of puffery.
Some people prefer it, but I'll bet you most Perlers have never even looked at it.
Not only that, the fragmentation of Mouse, Moose, Moo, and whatever else out there
is starting to confuse people who haven't started yet (so it's a frequent question
I get).</p>
</blockquote>

<p>Of course from inside the Modern Perl/<a href="http://moose.perl.org/">Moose</a> bubble it is hard to believe that people haven't heard of <a href="http://moose.perl.org/">Moose</a>. And while I do think <a href="http://moose.perl.org/">Moose</a> is seeping out more and more, brian, with his unique position of being a well known figure both inside and outside of the Perl community, is very much right about the confusion over <a href="http://moose.perl.org/">Moose</a>, <a href="http://search.cpan.org/dist/Mouse/">Mouse</a>, <a href="http://search.cpan.org/dist/Moo/">Moo</a>, et al. So after much discussion with the other core <a href="http://moose.perl.org/">Moose</a> team I decided it was time to write a blog post to help clear things up.</p>

<h2>Clearing up the Confusion</h2>

<p>So of course we (the core <a href="http://moose.perl.org/">Moose</a> devs) believe that <a href="http://moose.perl.org/">Moose</a> is the best choice, but we are not so ignorant as to believe that <a href="http://moose.perl.org/">Moose</a> is the right choice for everyone and every environment. And it was this exact reason that brought about <a href="http://search.cpan.org/dist/Mouse/">Mouse</a> and which is currently driving the <a href="http://search.cpan.org/dist/Moo/">Moo</a> effort. Additionally <a href="http://moose.perl.org/">Moose</a> has always tried it's best to not make you pay for features you don't use by doing things like compiling highly focused accessors and lazy loading features when possible, which, when taken to the extreme leads to modules like  <a href="http://search.cpan.org/dist/Class-Method-Modifiers/">Class::Method::Modifiers</a> and <a href="http://search.cpan.org/dist/Role-Basic/">Role::Basic</a> in which <a href="http://moose.perl.org/">Moose</a> features are extracted completely.</p>

<p>So how does all this fit into the <a href="http://moose.perl.org/">Moose</a> ecosystem??</p>

<h2>Moose vs. Mouse</h2>

<p>So as I said, we think <a href="http://moose.perl.org/">Moose</a> is the best choice, but when <a href="http://moose.perl.org/">Moose</a> is prohibitive, either because of startup overhead or memory usage, then <a href="http://search.cpan.org/dist/Mouse/">Mouse</a> is currently the best choice and one we encourage. Period.</p>

<p>In reality, there is no fragementation here because <a href="http://search.cpan.org/dist/Mouse/">Mouse</a> is very much commited to maintaining surface <a href="http://moose.perl.org/">Moose</a> compatability and runs a fair portion of the <a href="http://moose.perl.org/">Moose</a> test suite successfully (minus the Meta-Object tests of course).</p>

<p>Additionally tools like <a href="http://search.cpan.org/dist/Any-Moose/">Any::Moose</a> allow you to defer your decision and/or provide both options when possible. There have even been a few <a href="http://search.cpan.org/search?query=MooseX">MooseX::</a> modules ported to <a href="http://search.cpan.org/search?query=MouseX">MouseX</a> and while this practice is generally discouraged because there are simply too many moving parts to keep in sync, the need existed and so people obliged.</p>

<p>In the end, what is important for us is that people are <a href="http://www.modernperlbooks.com/mt/2010/01/subtle-encouragement-toward-correctness.html">writing good OO code</a> <a href="http://www.modernperlbooks.com/mt/2010/09/what-you-can-and-cannot-teach-about-encapsulation.html">following the guidelines that Moose encourages</a>. If, for whatever reason, they need to use <a href="http://search.cpan.org/dist/Mouse/">Mouse</a> to do that, it is okay with us. At least for now that is ...</p>

<h2>So what about Moo?</h2>

<p>Ever since the <a href="http://search.cpan.org/~stevan/Moose-0.01/">early days of Moose</a> we have been searching for ways to make <a href="http://moose.perl.org/">Moose</a> startup time faster. Recent heavy profiling by core Moose devs, <a href="http://tozt.net/">Jesse Luehrs</a> and <a href="http://blog.urth.org/">Dave Rolsky</a>, <a href="http://blog.moose.perl.org/2010/08/moose-110-and-classmop-105-now-compiling-10-faster.html">has</a> <a href="http://blog.moose.perl.org/2010/09/moose-113-making-moose-runtime-faster.html">lead</a> to some <a href="http://blog.moose.perl.org/2010/11/the-future-of-moose.html">pretty hefty speed-ups</a> and plans for even more in the future. But we know that there is only so far this path can take us.</p>

<p>And then we come to <a href="http://www.trout.me.uk/">mst</a> and <a href="http://search.cpan.org/dist/Moo/">Moo</a>.</p>

<p><a href="http://search.cpan.org/dist/Moo/">Moo</a> is an experiment from the sick and twisted mind of <a href="http://www.trout.me.uk/">mst</a> to radically re-think how <a href="http://moose.perl.org/">Moose</a> goes about compiling all it's meta objects. It builds on ideas from even more experimental <a href="http://search.cpan.org/dist/MooseX-Compile/">MooseX::Compile</a> born from the equally twisted mind of <a href="http://blog.woobling.org/">Yuval Kogman</a> and an earlier <a href="http://www.trout.me.uk/">mst</a> experiment called <a href="https://github.com/rafl/moosex-antlers">MooseX::Antlers</a>.</p>

<p>While <a href="http://www.trout.me.uk/">mst</a> and a few other brave souls are actually using <a href="http://search.cpan.org/dist/Moo/">Moo</a> successfully, it is currently only in very limited situations with very simple "baby" <a href="http://moose.perl.org/">Moose</a> code. And really in the end, if <a href="http://search.cpan.org/dist/Moo/">Moo</a> succeeds, you won't even know it is there because it will just be part of how <a href="http://moose.perl.org/">Moose</a> does it's thing. It is at this point that the community may choose to deprecate <a href="http://search.cpan.org/dist/Mouse/">Mouse</a>, but we will cross that bridge when we come to it.</p>

<p>So again, no real fragmentation here either, it is all part of the grand plan.</p>

<h2>Moose inspired</h2>

<p>The Perl community has long prided itself as being an group of independent minded (<em>cough</em> stubborn <em>cough</em>) people who don't just <a href="http://www.ruby-lang.org/en/">jump on</a> the <a href="http://rubyonrails.org/">shiniest bandwagon</a> or <a href="http://www.php.net/">take the easy way out</a>. We are well aware that <a href="http://moose.perl.org/">Moose</a> is a lot of <a href="http://en.wikipedia.org/wiki/Drinking_the_Kool-Aid">Kool-Aid</a> to drink and is not the right choice for everyone. And obviously because of this <a href="http://search.cpan.org/dist/Mouse/">Mouse</a> is not useful to these people either. So this is where some of the <a href="http://moose.perl.org/">Moose</a> inspired modules come into play.</p>

<p>In some cases these modules are re-implementations of <a href="http://moose.perl.org/">Moose</a> features, in other cases they are parts of <a href="http://moose.perl.org/">Moose</a> that have been extracted because of their usefulness to others outside of <a href="http://moose.perl.org/">Moose</a>. Here is a short, totally noncomprehensive list ...</p>

<ul>
<li><a href="http://search.cpan.org/dist/Class-Method-Modifiers/">Class::Method::Modifiers</a> - Moose/CLOS like method modifiers</li>
<li><a href="http://search.cpan.org/dist/Role-Basic/">Role::Basic</a> - <a href="http://blogs.perl.org/users/ovid/">Ovid's</a> latest Role module</li>
<li><a href="http://search.cpan.org/dist/Class-Load/">Class::Load</a> - This is the class loading code extracted from <a href="http://search.cpan.org/dist/Class-MOP/">Class::MOP</a></li>
<li><a href="http://search.cpan.org/dist/Package-Stash">Package::Stash</a> - This is the package stash/typeglob manipulation code also extracted from <a href="http://search.cpan.org/dist/Class-MOP/">Class::MOP</a></li>
<li><a href="http://search.cpan.org/dist/Class-Accessor">Class::Accessor</a> - A "moose-like" feature was recently added to this old standby of Perl OOP</li>
</ul>

<p>As we said above, the ultimate goal of <a href="http://moose.perl.org/">Moose</a> has always been to make writing good OO code in Perl a less tedious and repetitive process. While we think <a href="http://moose.perl.org/">Moose</a> is the best way to do that, it is understandable that sometimes you only need a small part of it and all these modules provide this. And really as long as they maintain some level of commitment to <a href="http://moose.perl.org/">Moose</a> compatability, this works for us because it still serves our ultimate goal.</p>

<p>So sure, a little fragmentation here, but with a compatability commitment these really just become gateway modules to <a href="http://moose.perl.org/">Moose</a>.</p>

<h2>Moose itch scratching</h2>

<p>And lastly, I wanted to touch on the number of modules that have been in some way inspired by or related to <a href="http://moose.perl.org/">Moose</a> development. This subject really deserves it's own blog post, but I think it is worth mentioning these modules.</p>

<ul>
<li><a href="http://search.cpan.org/dist/Dist-CheckConflicts/">Dist::CheckConflicts</a></li>
<li><a href="http://search.cpan.org/dist/Test-DependentModules/">Test::DependentModules</a></li>
<li><a href="http://search.cpan.org/dist/Devel-GlobalDestruction/">Devel::GlobalDestruction</a></li>
<li><a href="http://search.cpan.org/dist/Eval-Closure/">Eval::Closure</a></li>
<li><a href="http://search.cpan.org/dist/Package-DeprecationManager/">Package::DeprecationManager</a></li>
<li><a href="http://search.cpan.org/dist/Try-Tiny/">Try::Tiny</a></li>
<li><a href="http://search.cpan.org/dist/Test-Fatal/">Test::Fatal</a></li>
<li><a href="http://search.cpan.org/dist/List-AllUtils/">List::AllUtils</a></li>
<li><a href="http://search.cpan.org/dist/Devel-ChangePackage/">Devel::ChangePackage</a></li>
</ul>

<h2>Conclusion</h2>

<p>So hopefully this helps clear up some of the confusion that brian has seen on his adventures outside of the Modern Perl bubble. One of the really interesting and beautiful things about Open Source software development and the CPAN community in particular is that it really is a true meritocracy and functions extremely well as highly organized chaos. The drawback to that is that sometimes we have to clear up some confusion like this, which when viewed against the benefits is not that bad at all.</p>

<p>Happy New Year!</p>
]]>
        

    </content>
</entry>

<entry>
    <title>The Future of Moose</title>
    <link rel="alternate" type="text/html" href="http://blog.moose.perl.org/2010/11/the-future-of-moose.html" />
    <id>tag:blog.moose.perl.org,2010://3.158</id>

    <published>2010-11-18T05:36:44Z</published>
    <updated>2010-11-19T01:42:09Z</updated>

    <summary>A complaint that has come up multiple times over the past few months is that, as important as Moose is becoming in the Perl ecosystem, it should be more concerned with backwards compatibility. After a series of discussions, the Moose...</summary>
    <author>
        <name>Jesse Luehrs</name>
        
    </author>
    
    <category term="moose" label="moose" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="speed" label="speed" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.moose.perl.org/">
        <![CDATA[<p>A complaint that has come up multiple times over the past few months is that,
as important as Moose is becoming in the Perl ecosystem, it should be more
concerned with backwards compatibility. After a series of discussions, the
Moose development team has come up with a support policy that seems to satisfy
most people; you can read about it
<a href="https://github.com/moose/moose/blob/master/lib/Moose/Manual/Support.pod">here</a>.
The main points are: Moose will be moving to a time-boxed release cycle of
three months between (major) releases. Bug fixes and minor features can be
added in between major releases as long as they don't break backwards
compatibility (and we will put more effort into making sure they don't). Major
releases can break backwards compatibility, but we will release at least one
(ideally more than one) trial release before the actual release comes out, so
that people can test their own systems with the new features, and report back
with issues they may have. We will also do our best to assist maintainers of
Moose extensions with updating their modules for major changes, but not to the
point of taking over maintainership of extensions that have become
unmaintained. If you rely on a Moose extension whose maintainer has abandoned
it, feel free to find someone willing to take up maintainership, and come talk
to us on #moose, we'll be more than willing to help you get up to speed.</p>

<p>Now, on to the fun part(: The next Moose release will contain several exciting
new improvements, both for users and extension authors. The first is that there
has been a significant effort to speed up Moose's compilation time, through
several means. The largest and most obvious is that Package::Stash, the module
that Moose uses to do its symbol table manipulation (for adding and retrieving
methods, among other things), has been rewritten entirely in XS. Since Moose
spends over a third of its compilation time doing symbol table manipulation,
this seemed like a good optimization target, and this turns out to have been
correct - it resulted in a 10-15% speedup across the board for Moose
application compile times. Another advantage to this is that it fixes a couple
(admittedly minor) long-standing bugs in the Class::MOP::Package API, since the
symbol table API available from pure perl has several inherent issues itself.
Another area that should see significant improvement is in code which uses the
native delegation attribute traits. Previously (ever since the rewrite in
1.15), the traits themselves were loaded lazily (i.e.
Moose::Meta::Attribute::Native::Trait::Bool wasn't loaded unless you actually
declared an attribute with traits => ['Bool']), but the implementations of each
native delegation were all loaded at once, when the trait itself was loaded.
This has been fixed, and should be another fairly large speedup for
applications which use only a couple native delegations from the traits they
use (which is the case the vast majority of the time). Finally, the way method
metaobjects are cached has been improved, which speeds up the introspection of
methods (which happens frequently during compilation) a small but noticeable
amount. Here are some links to some relevant profiling data (run on my netbook
under full profiling, which is why the times are so high): <a href="http://tozt.net/moose/nytprof-kioku/">"perl -MKiokuDB
-e1" with Moose 1.19</a>: 8.60s, <a href="http://tozt.net/moose/nytprof-kioku-new/">"perl
-MKiokuDB -e1" with Moose git</a>:
6.38s, <a href="http://tozt.net/moose/nytprof-markdent/">"perl -MMarkdent::Simple::Document -e1" with Moose
1.19</a>: 13.9s, <a href="http://tozt.net/moose/nytprof-markdent-new/">"perl
-MMarkdent::Simple::Document -e1" with Moose
git</a>: 10.6s. These changes should
have minimal compatibility impact (and none at all if you don't use the
Class::MOP::Package API); a more detailed discussion is in
Moose::Manual::Delta.</p>

<p>In terms of features, we have made a fairly significant change to how attribute
metaroles work. Previously, when a role was applied to a class, it would copy
the attributes from the role into the class using the <em>class's</em> default
attribute metaclass, prior to applying the traits specified in the attribute
definition. This is obviously incorrect with a bit of thought - attribute
metaclasses completely define how the attribute works, including things like
how accessors are generated. If a role contains an attribute and some methods,
those methods need to be able to know what method name the accessor is going to
be installed under, or the role won't work. A good example of this is a class
which uses MooseX::FollowPBP consuming a role which doesn't - currently, this
completely breaks the role. With this change, roles now have their own default
attribute metaclass, separate from any class. This also allows for an
additional feature - when writing extensions, you can specify the
'applied_attribute' option to the 'role' block in 'apply_metaroles' to specify
a set of default traits that all attributes defined in that role will receive
when they are applied to a class. This should work identically to the
'attribute' option in the 'class' block, and should allow extensions which add
default attribute metaroles (such as MooseX::Aliases) to work identically in
both classes and roles (unlike currently, where the trait must be applied
explicitly in role attributes). The downside to this is that it breaks
backwards compatibility in a potentially confusing way: if you were assuming
and relying on role attributes using the class's attribute metaclass, your
roles will break, and there isn't really a way to detect this. The solution
will be to use the same extensions in your roles that you do in the classes
that consume those roles, but as noted previously, attribute metaroles don't
currently work in roles. These extensions will be fixed by the time we make an
actual release.</p>

<p>Finally, there is also some good news for extension authors: the inlining API
should be much more sane, and the code itself should be much more readable, so
adding inlined method generation support to your modules which affect accessor
or constructor/destructor generation should be much, much easier now. Some
highlights include: the attribute metaclass and class metaclass controlling
entirely how the bodies of the methods they generate are created (so there
should no longer be a need to write accessor or constructor metaclass traits),
accessor generation in Class::MOP and Moose going through one much simplified
codepath (read: removed the obscene amount of code duplication between
Class::MOP and Moose), so figuring out how a given accessor is generated should
be pretty trivial now, and constructors now asking the attribute metaclass how
to initialize attributes at construction time, rather than doing it themselves
with a bunch of duplicated code (so in the case of simple attribute traits
which affect accessor generation, manually modifying the constructor generation
shouldn't even be necessary). The downside to this is, as you may have guessed,
the API for doing code inlining has been changed pretty radically. This will
require some work on the part of extension authors, in order to use the new API
(since there's not really a non-insane way to support both APIs), but again,
we'll be working with extension authors to make sure this happens before our
actual release, and we'll be releasing a few dev releases prior to the actual
release to allow people with non-CPAN code to have a chance to update their
code.</p>

<p>As far as a plan goes, we're looking to have our first trial release out by the
end of this month, and are aiming for the actual release to happen sometime in
late December or early January. If you have any questions about the new release
and support process, or about any of these new features, definitely let us
know - we're very open to feedback, either here, on the Moose mailing list, or
on #moose-dev on IRC.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>Moose 1.18 - the bug fixes continue</title>
    <link rel="alternate" type="text/html" href="http://blog.moose.perl.org/2010/10/moose-118-the-bug-fixes-continue.html" />
    <id>tag:blog.moose.perl.org,2010://3.154</id>

    <published>2010-10-31T16:33:01Z</published>
    <updated>2011-01-05T12:20:47Z</updated>

    <summary>Moose 1.18 (and 1.17) are again primarily bug fix releases. In particular, we&apos;ve killed some bugs that were introduced in 1.15 with the changes to native delegations. If you&apos;re using native delegations in your code and you&apos;ve already installed Moose...</summary>
    <author>
        <name>Dave Rolsky</name>
        <uri>http://blog.urth.org/</uri>
    </author>
    
    <category term="bug_fixes" label="bug_fixes" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="moose" label="moose" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.moose.perl.org/">
        <![CDATA[<p>Moose 1.18 (and 1.17) are again primarily bug fix releases. In particular, we've killed some bugs that were introduced in 1.15 with the changes to native delegations. If you're using native delegations in your code and you've already installed Moose 1.15 or newer, we strongly encourage you to upgrade.</p>

<p>This release also fixes some random older bugs that have been lingering in <a href="https://rt.cpan.org/Public/Dist/Display.html?Name=Moose">rt.cpan</a> for a while.</p>

<p>Finally, this release moves Moose and all of its prereqs from <a href="http://search.cpan.org/dist/Test-Exception"><code>Test::Exception</code></a> to <a href="http://search.cpan.org/dist/Test-Fatal"><code>Test::Fatal</code></a>. <code>Test::Exception</code> depends on <a href="http://search.cpan.org/dist/Sub-Uplevel"><code>Sub::Uplevel</code></a>, a module that tends to break with changes in the Perl core. This should make Moose a little more robust against future core changes.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>Moose 1.16 - bug fixes, bug fixes, and more bug fixes</title>
    <link rel="alternate" type="text/html" href="http://blog.moose.perl.org/2010/10/moose-116-bug-fixes-bug-fixes-and-more-bug-fixes.html" />
    <id>tag:blog.moose.perl.org,2010://3.153</id>

    <published>2010-10-18T14:59:43Z</published>
    <updated>2010-10-18T15:06:54Z</updated>

    <summary>Moose 1.16 (and Class::MOP 1.10) will be out shortly, and it&apos;s mostly bug fixes. Among the bigger changes ... Native delegation methods which change the attribute value now have explicitly documented return values. Before 1.15, a lot of them had...</summary>
    <author>
        <name>Dave Rolsky</name>
        <uri>http://blog.urth.org/</uri>
    </author>
    
    <category term="bug_fixes" label="bug_fixes" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="moose" label="moose" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.moose.perl.org/">
        <![CDATA[<p>Moose 1.16 (and Class::MOP 1.10) will be out shortly, and it's mostly bug fixes.</p>

<p>Among the bigger changes ...</p>

<ul>
<li>Native delegation methods which change the attribute value now have explicitly documented return values. Before 1.15, a lot of them had implicit return values, and some of those return values were kind of confusing. Now we make a point of returning whatever the equivalent Perl builtin operation would return, and we document that.</li>
<li>Native delegations have better docs in general.</li>
<li>Some native delegation methods which required a string argument didn't accept an empty string, like <code>Array-&gt;join</code>. Oops, that was wrong.</li>
<li>Deprecation warnings have been improved. They're now more likely to find the right caller of the deprecated feature, some of the warnings have been improved, and we've fixed some cases where you got a warning when you were doing something perfectly acceptable.</li>
</ul>

<p>You can take a look at <a href="http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo/Moose.git;a=blob_plain;f=Changes;h=59f02a4c9adab1598fbcd69f2e376711fb931b08;hb=39f9de27d6202e0e31b36e269ab137007fe73a05">Changes in git</a> while the release makes its way to CPAN.</p>

<p>If you're using 1.15, you should probably upgrade to 1.16. If you're on an earlier version, you should consider upgrading too. As always, please test your code with the new Moose.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>What&apos;s New in Moose 1.15</title>
    <link rel="alternate" type="text/html" href="http://blog.moose.perl.org/2010/10/whats-new-in-moose-115.html" />
    <id>tag:blog.moose.perl.org,2010://3.149</id>

    <published>2010-10-05T19:25:20Z</published>
    <updated>2010-10-05T19:33:27Z</updated>

    <summary>The latest release of Moose is out, and it has some big changes for Native traits. Native trait delegations are now turned into inline code, just like regular attributes. What this means is that Moose actually generates Perl code when...</summary>
    <author>
        <name>Dave Rolsky</name>
        <uri>http://blog.urth.org/</uri>
    </author>
    
    <category term="moose" label="moose" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.moose.perl.org/">
        <![CDATA[<p>The latest release of Moose is out, and it has some big changes for Native traits.</p>

<p>Native trait delegations are now turned into inline code, just like regular attributes. What this means is that Moose actually generates Perl code when your class loads and then <code>eval</code>s it.</p>

<p>The upside is that this makes native trait delegations faster, potentially <em>much</em> faster. With previous versions of Moose, if you defined a native trait as <code>ro</code> or <code>bare</code>, then you could easily end up with a pathologically slow case for delegation.</p>

<p>With the latest Moose, all code is inlined to use direct slot access, which is much faster.</p>

<p>As a bonus, native trait attributes now act more correctly. Constraints are always checked when the value of the attribute changes, and triggers are also fired.</p>

<p>The downside of more code generation is that this makes the compile time a little slower (in direct proportion to how many native delegations you use).</p>

<p>We've also made it possible to prevent Moose from adding a <code>meta</code> method to your class. This is handy for classes which are inheritng from a non-Moose parent (like <code>Rose::DB::Object</code>) that <em>also</em> defines a meta method.</p>

<p>That's the highlights of 1.15. Some of these changes (like checking constraints properly for native traits) could break existing code. Please make sure to read <code>Moose::Manual::Delta</code> when you upgrade!</p>
]]>
        

    </content>
</entry>

<entry>
    <title>Moose Backwards Compatibility Policy and Practice</title>
    <link rel="alternate" type="text/html" href="http://blog.moose.perl.org/2010/09/moose-backwards-compatibility-policy-and-practice.html" />
    <id>tag:blog.moose.perl.org,2010://3.148</id>

    <published>2010-09-28T02:21:44Z</published>
    <updated>2010-09-28T14:44:31Z</updated>

    <summary>Moose 1.15 will be out the door shortly (he says with hope in his heart), and it will include a few incompatibilities along with some bug fixes and speedups. It&apos;s worthwhile to discuss both the philosophy and actual practice of...</summary>
    <author>
        <name>Dave Rolsky</name>
        <uri>http://blog.urth.org/</uri>
    </author>
    
    <category term="back_compat" label="back_compat" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="moose" label="moose" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="policy" label="policy" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.moose.perl.org/">
        <![CDATA[<p>Moose 1.15 will be out the door shortly (he says with hope in his heart), and it will include a few incompatibilities along with some bug fixes and speedups.</p>

<p>It's worthwhile to discuss both the philosophy and actual practice of backwards compatibility in Moose, so end users know what to expect.</p>

<p>There are a couple principles at work.</p>

<ol>
<li>Moose favors correctness over backwards compatibility.</li>
<li>Moose supports documented behavior, not accidental behavior or side effects.</li>
</ol>

<p>These two principles are often related.</p>

<p>In this next release, methods generated by using a native trait will now check their arguments. If you try to pass an argument to an Array's <code>count()</code> method, it will throw an error.</p>

<p>We never documented this one way or another, and the current behavior is clearly wrong, so we feel that changing this is okay.</p>

<p>When incorrect behavior <em>is</em> documented, we don't remove it outright if we can possibly avoid it. Instead, we add a deprecation warning, and will remove it eventually.</p>

<p>This stands in contrast to other projects, like <a href="http://www.shadowcat.co.uk/blog/matt-s-trout/backwards-compatibility-and-migration-paths/">Catalyst, which has a much stronger backwards compatibility guarantee</a>.</p>

<p>So that's the policy, but how about the practice?</p>

<p>We do a <em>lot</em> of testing to smoke these changes. A while back, I wrote a module called <a href="http://search.cpan.org/dist/Test-DependentModules">Test::DependentModules</a> which allows you to test some or all of the modules dependent on a given module. While we don't test <em>every</em> dependent, since lots of them are stale, we do test quite a few. If you have something on CPAN you'd like to include in the tests, just let us know via <a href="irc://irc.perl.org/#moose">irc</a> or <a href="mailto:moose@perl.org">email</a>.</p>

<p>When this test finds a problem with a change, we usually offer to help downstream authors change their code, and we try to synchronize new releases of Moose with new releases of dependents. It's most often MooseX modules which get broken, because many of them are intimate with the Moose internals. It's less common for modules which simply <em>use</em> Moose to break outright.</p>

<p><a href="http://search.cpan.org/dist/Fey-ORM">Fey::ORM</a> is effectively a MooseX module, despite the name, as are a few others. Some modules, like <a href="http://search.cpan.org/dist/Catalyst-Runtime">Catalyst</a>, poke around in the more arcane corners of Moose, and tend to be more easily broken.</p>

<p>We also maintain a list of conflicting module versions by hand in our Makefile.PL. Unfortunately, the CPAN toolchain doesn't (yet?) have any sort of real support for conflict handling, so all we can do is print out some warnings to the terminal at install time. I hope that in the future, there will be an official way to declare conflicts. Then CPAN clients can let the user choose how to handle them (update the conflicting module, ignore, don't install the new Moose).</p>

<p>Finally, we expect that end users test new versions of Moose (and of any other dependency) before deploying to production. If you don't have testing that you trust, you probably shouldn't be upgrading at all!</p>

<p>This is also <a href="http://search.cpan.org/dist/Moose/lib/Moose/Manual/Support.pod#DEPRECATION_POLICY">documented in the Moose docs</a>, but with less detail.</p>

<p>Hopefully this helps make our decisions a little more transparent. Comments (sans too much flame) are welcome.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>Moose 1.13, making Moose runtime faster</title>
    <link rel="alternate" type="text/html" href="http://blog.moose.perl.org/2010/09/moose-113-making-moose-runtime-faster.html" />
    <id>tag:blog.moose.perl.org,2010://3.146</id>

    <published>2010-09-13T22:21:47Z</published>
    <updated>2010-09-13T22:27:06Z</updated>

    <summary>For the most part, Moose is pretty well optimized for runtime operations. If you make a class immutable, your constructor will be as fast as it can be. Similarly, attributes are always inlined with the most optimal code we can...</summary>
    <author>
        <name>Dave Rolsky</name>
        <uri>http://blog.urth.org/</uri>
    </author>
    
    <category term="moose" label="moose" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="speed" label="speed" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.moose.perl.org/">
        <![CDATA[<p>For the most part, Moose is pretty well optimized for runtime operations. If you make a class immutable, your constructor will be as fast as it can be. Similarly, attributes are always inlined with the most optimal code we can generate.</p>

<p>However, I've been doing some profiling recently of some of my Moose-using modules, and I've found some areas for improvement.</p>

<p>The 1.13 release addresses one of these. Previously, calls to <code>$object-&gt;does()</code> were fairly slow, especially for classes with a bunch of roles or deep inheritance hierarchies. The <code>does()</code> method ended up looking up roles in the metaclass object, and it did this in a really slow way.</p>

<p>With 1.13, all of a class's roles are captured in a hash, and we can look up any role in the time it takes to look up a hash key. If your app makes a lot of calls to <code>does()</code> then this might help. Note that calls to <code>does</code> can happen behind the scenes with any sort of role-based type constraint.</p>

<p>Next up on my list are native traits. It turns out that the code which implements these often goes through some <em>really</em> slow paths in Moose. I'm going to make all native traits inlined as well. In the best case, that will generate code like <code>push @{ $self-&gt;{foo} }, @_</code>, which will be <em>much</em> faster than what we do now.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>Moose 1.10 and Class::MOP 1.05, Now Compiling 10% Faster?</title>
    <link rel="alternate" type="text/html" href="http://blog.moose.perl.org/2010/08/moose-110-and-classmop-105-now-compiling-10-faster.html" />
    <id>tag:blog.moose.perl.org,2010://3.145</id>

    <published>2010-08-22T15:36:32Z</published>
    <updated>2010-08-22T15:43:46Z</updated>

    <summary>I did a lot of profiling and optimization work for the latest releases of Moose and Class::MOP. My focus was on improving module compilation speed. My profiling workload was simply running perl -d:NYTProf -MMarkdent::Simple::Document -e1 The Markdent module in question...</summary>
    <author>
        <name>Dave Rolsky</name>
        <uri>http://blog.urth.org/</uri>
    </author>
    
    <category term="moose" label="moose" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="speed" label="speed" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.moose.perl.org/">
        <![CDATA[<p>I did a lot of profiling and optimization work for the latest releases of Moose and Class::MOP. My focus was on improving module compilation speed. My profiling workload was simply running <code>perl -d:NYTProf -MMarkdent::Simple::Document -e1</code></p>

<p>The <a href="http://search.cpan.org/dist/Markdent">Markdent</a> module in question loads a lot of Moose-using modules, uses plenty of roles, and is generally a good Moose compilation workout.</p>

<p>When profiling, I found that the biggest culprit was looking up methods in a module's namespace. We were making nearly 10,000 calls to <code>Class::MOP::Mixin::HasMethods-&gt;get_method</code>, which is one of our most expensive operations. I was able to reduce the number of calls to under 4,000.</p>

<p>What's a bit sad, however, is that this only appears to save 6-10% of the compilation time in real usage. I'm not sure why that is, but I think the issue is that the perl core's compilation time may be a big factor. As I said, loading that one Markdent modules loads a <em>lot</em> of modules (203 individual <code>.pm</code> files), and the raw overhead of simply reading all those files and compiling them may be a significant chunk of the compilation time.</p>

<p>It's really hard to test this theory, though, since I don't really have a non-Moose version of Markdent to test as a control.</p>

<p>Anyway, this latest release of Moose and CMOP at least provides some speedups. Thanks to Tim Bunce for working on <a href="http://search.cpan.org/dist/Devel-NYTProf">Devel::NYTProf</a>. It's a fantastic tool, and it makes profiling a pleasure to do.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>Welcome to the Moose Blog and Moose 1.09</title>
    <link rel="alternate" type="text/html" href="http://blog.moose.perl.org/2010/07/welcome-to-the-moose-blog-and-moose-109.html" />
    <id>tag:blog.moose.perl.org,2010://3.142</id>

    <published>2010-07-25T15:32:09Z</published>
    <updated>2010-07-25T15:39:27Z</updated>

    <summary>Welcome to the new Moose blog, where we blog about Moose and MooseX and anything else of relevance. We&apos;ll be using this blog to announce interesting Moose projects, upcoming API changes and deprecations, and maybe to write fascinating articles about...</summary>
    <author>
        <name>Dave Rolsky</name>
        <uri>http://blog.urth.org/</uri>
    </author>
    
    <category term="moose" label="moose" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.moose.perl.org/">
        <![CDATA[<p>Welcome to the new Moose blog, where we blog about Moose and MooseX and anything else of relevance.</p>

<p>We'll be using this blog to announce interesting Moose projects, upcoming API changes and deprecations, and maybe to write fascinating articles about Moose (enthusiasm and energy permitting).</p>

<p>I've just released Moose 1.09, which includes a number of changes. Notable, this release includes an API change or two, as well as a whole bunch of deprecation warnings.</p>

<p>For a long time, we've been <em>saying</em> that features are deprecated in the Changes file, but not actually changing the code. With Moose 1.09, every feature that's been marked deprecated in the past couple years now issues a warning. To make the warnings less intrusive, I wrote a new package called <a href="http://search.cpan.org/dist/Package-DeprecationManager">Package::DeprecationManager</a>. This module manages the deprecation warnings and ensures that a given warning only shows up once per package. This should avoid any "I upgraded and now my logs filled my disk" disasters.</p>

<p>Actually warning about deprecated features is the first step towards removing them in the future, so please address any warnings you see in your own code.</p>

<p>A number of MooseX modules will trigger these warnings. In many cases, we were able to help the CPAN authors update their code, and we added a conflict warning to the Makefile.PL, so please look out for the conflict warning. However, in the interest of getting code released, not every MooseX module has been updated. If you are using a module which now warns, please file a bug for that module. MooseX module authors, the fixes are generally very simple. If you have question, please just us in the <a href="irc://irc.perl.org/#moose-dev">#moose-dev IRC channel</a> or <a href="mailto:moose@perl.org">send email to the Moose mailing list</a>.</p>
]]>
        

    </content>
</entry>

</feed>
