<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5205671691245928993</id><updated>2011-09-08T00:46:26.015-07:00</updated><category term='parameterized-roles'/><category term='dancer'/><category term='mop'/><category term='cpan'/><category term='dwimery'/><category term='perl'/><category term='mojo'/><category term='mst'/><category term='oop'/><category term='japan-perl-organization'/><category term='plumbing'/><category term='autobox'/><category term='moose'/><category term='frameworks'/><category term='perl5i'/><category term='yapc'/><category term='perl-oasis'/><category term='marketing'/><category term='roles'/><category term='padre'/><category term='opw'/><category term='catalyst'/><category term='api-design'/><category term='leaks'/><category term='plack'/><title type='text'>Stevan Little's Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://stevan-little.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://stevan-little.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Stevan Little</name><uri>http://www.blogger.com/profile/01804375611677923875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_IhjVLbgZUmM/SpasL5rYhvI/AAAAAAAAABM/rxnwCbK3NA8/S220/n584352672_3079.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>21</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5205671691245928993.post-891874663221587070</id><published>2010-05-19T08:40:00.001-07:00</published><updated>2010-05-19T09:00:42.938-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='moose'/><category scheme='http://www.blogger.com/atom/ns#' term='catalyst'/><category scheme='http://www.blogger.com/atom/ns#' term='marketing'/><category scheme='http://www.blogger.com/atom/ns#' term='cpan'/><category scheme='http://www.blogger.com/atom/ns#' term='yapc'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><category scheme='http://www.blogger.com/atom/ns#' term='mst'/><title type='text'>VOTE TRANSPARENT</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://moose.perl.org/vote-transparent.html"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 632px; height: 408px;" src="http://bit.ly/d9vjnA" border="0" alt="" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5205671691245928993-891874663221587070?l=stevan-little.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stevan-little.blogspot.com/feeds/891874663221587070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stevan-little.blogspot.com/2010/05/vote-transparent.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/891874663221587070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/891874663221587070'/><link rel='alternate' type='text/html' href='http://stevan-little.blogspot.com/2010/05/vote-transparent.html' title='VOTE TRANSPARENT'/><author><name>Stevan Little</name><uri>http://www.blogger.com/profile/01804375611677923875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_IhjVLbgZUmM/SpasL5rYhvI/AAAAAAAAABM/rxnwCbK3NA8/S220/n584352672_3079.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5205671691245928993.post-7865923129583102910</id><published>2010-04-22T11:47:00.000-07:00</published><updated>2010-04-22T11:54:46.140-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='moose'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Ich bin ein Moose-er</title><content type='html'>Thanks to the efforts of Lars Dieckow&lt;span class="Apple-style-span"   style="  -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family:'Lucida Grande', Arial;font-size:medium;"&gt; (&lt;/span&gt;daxim) the new &lt;a href="http://moose.perl.org/"&gt;Moose&lt;/a&gt; website has already gotten a ton of nice SEO and accessibility improvements, but now we have our first official translation into German. So I would like to announce the launch of &lt;a href="http://moose.perl.org/de"&gt;http://moose.perl.org/de&lt;/a&gt;.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If anyone else would like to do some translating, &lt;a href="http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo/moose-website.git;a=summary"&gt;patches are always welcome&lt;/a&gt;.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;p style="margin: 0.0px 0.0px 0.0px 222.0px; text-indent: -222.0px; font: 10.0px Monaco"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin: 0.0px 0.0px 0.0px 222.0px; text-indent: -222.0px; font: 10.0px Monaco"&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5205671691245928993-7865923129583102910?l=stevan-little.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stevan-little.blogspot.com/feeds/7865923129583102910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stevan-little.blogspot.com/2010/04/ich-bin-ein-moose-er.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/7865923129583102910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/7865923129583102910'/><link rel='alternate' type='text/html' href='http://stevan-little.blogspot.com/2010/04/ich-bin-ein-moose-er.html' title='Ich bin ein Moose-er'/><author><name>Stevan Little</name><uri>http://www.blogger.com/profile/01804375611677923875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_IhjVLbgZUmM/SpasL5rYhvI/AAAAAAAAABM/rxnwCbK3NA8/S220/n584352672_3079.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5205671691245928993.post-5890677752241350886</id><published>2010-04-07T08:19:00.001-07:00</published><updated>2010-04-07T08:29:04.959-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='moose'/><category scheme='http://www.blogger.com/atom/ns#' term='marketing'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>New Moose Website</title><content type='html'>I released a new version of the &lt;a href="http://moose.perl.org"&gt;Moose&lt;/a&gt; website earlier this week. It retains much of the old content, but is now a multi-page site with much more room to grow. In the coming months I hope to also better organize the content and make this site into a go-to resource for all things Moose.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And in the spirit of the keeping Moose a community driven project, I have made the code that generates the Moose site available via git (the instructions for this are in the &lt;a href="http://article.gmane.org/gmane.comp.lang.perl.moose/1467"&gt;original mailing list announcement&lt;/a&gt;). We have already gotten several commits to improve our markup and CSS (daxim++) as well as making the "&lt;a href="http://www.iinteractive.com/moose/about.html#organizations"&gt;Organizations that use Moose&lt;/a&gt;" linkable (jhannah++). &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5205671691245928993-5890677752241350886?l=stevan-little.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stevan-little.blogspot.com/feeds/5890677752241350886/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stevan-little.blogspot.com/2010/04/new-moose-website.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/5890677752241350886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/5890677752241350886'/><link rel='alternate' type='text/html' href='http://stevan-little.blogspot.com/2010/04/new-moose-website.html' title='New Moose Website'/><author><name>Stevan Little</name><uri>http://www.blogger.com/profile/01804375611677923875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_IhjVLbgZUmM/SpasL5rYhvI/AAAAAAAAABM/rxnwCbK3NA8/S220/n584352672_3079.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5205671691245928993.post-8722764051460585686</id><published>2010-03-25T11:51:00.000-07:00</published><updated>2010-03-25T12:13:19.355-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='moose'/><category scheme='http://www.blogger.com/atom/ns#' term='cpan'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Moose 1.00 is released</title><content type='html'>&lt;div&gt;With help from &lt;a href="http://perldition.org/"&gt;Florian Ragwitz&lt;/a&gt; and all the rest of the Moose contributors, I just uploaded &lt;a href="https://pause.perl.org/incoming/Moose-1.00.tar.gz"&gt;Moose 1.00&lt;/a&gt; and &lt;a href="https://pause.perl.org/incoming/Class-MOP-1.00.tar.gz"&gt;Class::MOP 1.00&lt;/a&gt; to the CPAN! And I am proud to say that over the last eight months or so, I have barely contributed more then a handful of lines of code to the project. This is not to say that I have abandoned it, but that it has now moved beyond me and is truly a community driven and developed project. And to that I raise my glass and say ...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://img.skitch.com/20100325-pw3pq53xu25971bs5ughi2qbw9.jpg" style="text-decoration: none;"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 640px; height: 480px;" src="http://img.skitch.com/20100325-pw3pq53xu25971bs5ughi2qbw9.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Of course this doesn't mean anything more then 0.99 meant, &lt;a href="http://www.perlmonks.org/?node_id=608144"&gt;I declared Moose 0.18 to be stable and ready to use&lt;/a&gt; almost 3 years ago, but reaching this release is still a milestone if only in that it will make it easier for some people convince their bosses to let them use Moose :)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5205671691245928993-8722764051460585686?l=stevan-little.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stevan-little.blogspot.com/feeds/8722764051460585686/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stevan-little.blogspot.com/2010/03/moose-100-is-released.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/8722764051460585686'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/8722764051460585686'/><link rel='alternate' type='text/html' href='http://stevan-little.blogspot.com/2010/03/moose-100-is-released.html' title='Moose 1.00 is released'/><author><name>Stevan Little</name><uri>http://www.blogger.com/profile/01804375611677923875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_IhjVLbgZUmM/SpasL5rYhvI/AAAAAAAAABM/rxnwCbK3NA8/S220/n584352672_3079.jpg'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5205671691245928993.post-949072862338018194</id><published>2010-02-01T14:58:00.001-08:00</published><updated>2010-02-01T15:07:48.727-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mojo'/><category scheme='http://www.blogger.com/atom/ns#' term='frameworks'/><category scheme='http://www.blogger.com/atom/ns#' term='dancer'/><category scheme='http://www.blogger.com/atom/ns#' term='catalyst'/><category scheme='http://www.blogger.com/atom/ns#' term='plack'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>On Frameworks ...</title><content type='html'>&lt;div&gt;So I was reading &lt;a href="http://perlalchemy.blogspot.com/2010/02/frameworks-are-framing-libraries-are.html"&gt;zby's latest blog post on frameworks and libraries&lt;/a&gt;. On some level I agree with him that often times frameworks are basically just codified "convention", but I really don't see this as a bad thing, and here is why.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As I see it, the purpose of a library is to provide generic re-usable code that can be used in many different contexts. The purpose of a framework is to provide a set of guidelines/conventions/best-practices which a developer can then build upon, therefore avoiding the need to set those guidelines/dictate those conventions/determine those best practices themselves.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Some frameworks are more opinionated and complex (&lt;a href="http://rubyonrails.org/"&gt;RoR&lt;/a&gt;, &lt;a href="http://search.cpan.org/dist/Catalyst-Runtime/"&gt;Catalyst&lt;/a&gt;, etc) and push/force you into their way of thinking, the benefit being that they also provide you with lots of building blocks that often times are zero-conf. While others (&lt;a href="http://search.cpan.org/dist/Dancer/"&gt;Dancer&lt;/a&gt;, &lt;a href="http://search.cpan.org/dist/Web-Simple/"&gt;Web::Simple&lt;/a&gt;, &lt;a href="http://search.cpan.org/~kraih/Mojo-0.999914/lib/Mojolicious/Lite.pm"&gt;Mojolicious::Lite&lt;/a&gt;, etc) are more focused and purposefully simple, they leave many problems unsolved therefore allowing more freedom for the developer. Each of these approaches has merit and neither is truly superior in all contexts, which brings me to &lt;a href="http://plackperl.org/"&gt;Plack&lt;/a&gt; and why I think this explosion of "frameworks" is a really good thing.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The ubiquity of &lt;a href="http://plackperl.org/"&gt;Plack&lt;/a&gt; means that all these frameworks can be (fairly) easily used within the same application (or set of applications). It should (eventually) be very easy to have your &lt;a href="http://search.cpan.org/dist/Catalyst-Runtime/"&gt;Catalyst&lt;/a&gt; application  running next to your &lt;a href="http://search.cpan.org/dist/Dancer/"&gt;Dancer&lt;/a&gt; application, running next to your &lt;a href="http://github.com/zby/WebNano"&gt;WebNano&lt;/a&gt; application, all sharing the same session data, user information, etc. through &lt;a href="http://search.cpan.org/dist/Plack/"&gt;Plack::Middleware&lt;/a&gt; components and mounted under a single &lt;a href="http://search.cpan.org/dist/Plack/"&gt;Plack::App::URLMap&lt;/a&gt; and controlled easily using &lt;a href="http://search.cpan.org/dist/Plack/"&gt;plackup&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5205671691245928993-949072862338018194?l=stevan-little.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stevan-little.blogspot.com/feeds/949072862338018194/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stevan-little.blogspot.com/2010/02/on-frameworks.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/949072862338018194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/949072862338018194'/><link rel='alternate' type='text/html' href='http://stevan-little.blogspot.com/2010/02/on-frameworks.html' title='On Frameworks ...'/><author><name>Stevan Little</name><uri>http://www.blogger.com/profile/01804375611677923875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_IhjVLbgZUmM/SpasL5rYhvI/AAAAAAAAABM/rxnwCbK3NA8/S220/n584352672_3079.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5205671691245928993.post-1697800509804209235</id><published>2010-01-25T13:27:00.001-08:00</published><updated>2010-01-25T13:34:29.117-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='moose'/><category scheme='http://www.blogger.com/atom/ns#' term='opw'/><category scheme='http://www.blogger.com/atom/ns#' term='plack'/><category scheme='http://www.blogger.com/atom/ns#' term='cpan'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><category scheme='http://www.blogger.com/atom/ns#' term='perl-oasis'/><title type='text'>Perl Oasis Slides</title><content type='html'>So I finally found some time this weekend to annotate my &lt;a href="http://iinteractive.com/moose/hosted-presentations/2009/Untitled-12-slides/index.html"&gt;slides&lt;/a&gt; from &lt;a href="http://perloasis.org/opw2010/"&gt;OPW&lt;/a&gt; and get them uploaded to the interweb. The theme of the talk was two fold. First was that we all stand on top of the shoulders of those who came before us and that Open Source is a great context in which to do that, both when building on top of computer science concepts and when borrowing lessons learned from other language communities. The second half the talk was about my recent experiments using &lt;a href="http://plackperl.org/"&gt;Plack&lt;/a&gt; (which is &lt;i&gt;the&lt;/i&gt; &lt;a href="http://plackperl.org/"&gt;Perl Web Server&lt;/a&gt;, in case you hadn't heard), &lt;a href="http://search.cpan.org/dist/Bread-Board/"&gt;Bread::Board&lt;/a&gt;, &lt;a href="http://search.cpan.org/dist/Path-Router/"&gt;Path::Router&lt;/a&gt; and &lt;a href="http://moose.perl.org"&gt;Moose&lt;/a&gt;, which I combined together as an experiment I call &lt;a href="http://github.com/stevan/OX"&gt;OX&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5205671691245928993-1697800509804209235?l=stevan-little.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stevan-little.blogspot.com/feeds/1697800509804209235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stevan-little.blogspot.com/2010/01/perl-oasis-slides.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/1697800509804209235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/1697800509804209235'/><link rel='alternate' type='text/html' href='http://stevan-little.blogspot.com/2010/01/perl-oasis-slides.html' title='Perl Oasis Slides'/><author><name>Stevan Little</name><uri>http://www.blogger.com/profile/01804375611677923875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_IhjVLbgZUmM/SpasL5rYhvI/AAAAAAAAABM/rxnwCbK3NA8/S220/n584352672_3079.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5205671691245928993.post-8539434310346148395</id><published>2010-01-21T18:06:00.000-08:00</published><updated>2010-01-21T18:10:09.436-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='plack'/><category scheme='http://www.blogger.com/atom/ns#' term='cpan'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Plack - The Perl Web Server</title><content type='html'>Wow, in less then a week it seems that &lt;a href="http://plackperl.org/"&gt;Plack&lt;/a&gt; has climbed to &lt;a href="http://www.google.com/search?client=safari&amp;amp;rls=en&amp;amp;q=Perl+Web+Server&amp;amp;ie=UTF-8&amp;amp;oe=UTF-8"&gt;number seven in Google search results&lt;/a&gt; for &lt;a href="http://plackperl.org/"&gt;Perl Web Server&lt;/a&gt;. It is only a matter of time before the hivemind that is Google realizes what we already know, that &lt;a href="http://plackperl.org/"&gt;Plack&lt;/a&gt; is *the* &lt;a href="http://plackperl.org/"&gt;Perl Web Server&lt;/a&gt; for the new millennium!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5205671691245928993-8539434310346148395?l=stevan-little.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stevan-little.blogspot.com/feeds/8539434310346148395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stevan-little.blogspot.com/2010/01/plack-perl-web-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/8539434310346148395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/8539434310346148395'/><link rel='alternate' type='text/html' href='http://stevan-little.blogspot.com/2010/01/plack-perl-web-server.html' title='Plack - The Perl Web Server'/><author><name>Stevan Little</name><uri>http://www.blogger.com/profile/01804375611677923875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_IhjVLbgZUmM/SpasL5rYhvI/AAAAAAAAABM/rxnwCbK3NA8/S220/n584352672_3079.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5205671691245928993.post-6918167600326120072</id><published>2010-01-18T10:09:00.001-08:00</published><updated>2010-01-18T10:53:36.797-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='opw'/><category scheme='http://www.blogger.com/atom/ns#' term='roles'/><category scheme='http://www.blogger.com/atom/ns#' term='plack'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><category scheme='http://www.blogger.com/atom/ns#' term='perl-oasis'/><title type='text'>Perl Oasis 2010</title><content type='html'>So this weekend I went down to the &lt;a href="http://perloasis.org/opw2010/"&gt;Perl Oasis&lt;/a&gt; (a.k.a - &lt;a href="http://perloasis.org/opw2010/"&gt;Orlando Perl Workshop&lt;/a&gt;, or &lt;a href="http://perloasis.org/opw2010/"&gt;OPW&lt;/a&gt; for short), which is a small one day conference run by &lt;a href="http://chris.prather.org/"&gt;Chris Prather&lt;/a&gt; and his wife &lt;a href="http://superawesomecool.org/"&gt;Jamie&lt;/a&gt;. I had missed it last year, but I heard so many good reviews of it I decided that this year I couldn't miss it, and I am really glad I didn't because I had a really great time. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There were lots of great people, great talks and great conversation. Some highlights include &lt;a href="http://bulknews.typepad.com/blog/"&gt;miyagawa&lt;/a&gt;'s &lt;a href="http://www.plackperl.org/"&gt;Plack&lt;/a&gt; talk (&lt;a href="http://plackperl.org/"&gt;Plack&lt;/a&gt; really should be the top search result for "&lt;a href="http://plackperl.org/"&gt;Perl Web Server&lt;/a&gt;"), &lt;a href="http://lucasoman.com/"&gt;Lucas Oman&lt;/a&gt; gave a really interesting talk about trying to implement &lt;a href="http://perloasis.org/opw2010/talk/2510"&gt;Roles in PHP&lt;/a&gt;, the always entertaining &lt;a href="http://www.shadowcat.co.uk/blog/matt-s-trout/"&gt;Matt Trout&lt;/a&gt; gave a talk in the form of an epic poem and many more.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I find that I really enjoy the small and short conferences, they are usually on a weekend (less work juggling to do) and everything is a group activity enjoyed by all (much easier to coordinate activities when you don't have 300+ attendees). This conference, along with the always fun &lt;a href="http://pghpw.org/"&gt;Pittsburgh Perl Workshop&lt;/a&gt; are now both on my "can't miss" list. &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5205671691245928993-6918167600326120072?l=stevan-little.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stevan-little.blogspot.com/feeds/6918167600326120072/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stevan-little.blogspot.com/2010/01/perl-oasis-2010.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/6918167600326120072'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/6918167600326120072'/><link rel='alternate' type='text/html' href='http://stevan-little.blogspot.com/2010/01/perl-oasis-2010.html' title='Perl Oasis 2010'/><author><name>Stevan Little</name><uri>http://www.blogger.com/profile/01804375611677923875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_IhjVLbgZUmM/SpasL5rYhvI/AAAAAAAAABM/rxnwCbK3NA8/S220/n584352672_3079.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5205671691245928993.post-3237376613781709277</id><published>2009-09-04T04:46:00.000-07:00</published><updated>2009-09-04T06:41:17.337-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='moose'/><category scheme='http://www.blogger.com/atom/ns#' term='padre'/><category scheme='http://www.blogger.com/atom/ns#' term='cpan'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Re: Re: Re: Moose Or No Moose</title><content type='html'>&lt;div&gt;This has been a crazy week here in Moose-land as you might have read. I would like to attempt to sum this all up so that we can all move on and get back to programming (which is sooooooo much more fun then blogging).&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Adam Kennedy responded to all this in &lt;a href="http://use.perl.org/~Alias/journal/39573"&gt;his recent use.perl post&lt;/a&gt;, and then later came into the #moose IRC channel to discuss. In that post I think that he did an excellent job of answering the "Should Padre use Moose" question. His conclusion seemed to be "Not Yet" which I can respect given his well thought out reasons. I was also happy to see that Adam felt Moose had the "air of inevitability" about it, and he felt it was only a matter of time till the Moose community solved our startup time and memory efficiency issues.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For the record, I was never actually suggesting that Padre should immediately be re-written in Moose, but more that Padre and Moose might benefit from one another, and would those benefits perhaps outweigh the costs. For Adam (and I assume the rest of the Padre team) the answer was "Not Yet", that the costs were too high and that benefits not compelling enough for them.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then this morning I arrived at my desk to see Daisuke Maki had &lt;a href="http://mt.endeworks.jp/d-6/2009/09/to-moose-or-not-to-moose.html"&gt;posted his 2 cents&lt;/a&gt; about this debate. Two lines in Daisuke's post jumped out at me. The first was this one:&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;&lt;i&gt;I'd really like them [the Moose develoers] to make a more thought-out response, and act like you actually care about the parties involved that have a slightly different view than yours&lt;/i&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;And the second was:&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;&lt;i&gt;That will make my life easier. I can point people to the Moose roadmap or whatever and say, "look, they care. they /will/ address your concerns. let's just install Moose in your system for now, yeah?" and go on hacking with Moose.&lt;/i&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;So while I don't have any official roapmap yet, I will say that "we are working on it" and "we do care". If nothing more, this recent debate has served to light a fire under the Moose development team and forced us to take a closer look at ourselves. It is a challenge and one that we are ready to take on.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;The first step is to admit that you have a problem. &lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So last night (after a challenge from Adam on IRC) Jesse (doy) Luehrs &lt;a href="http://tozt.net/uploads/text/moose_bench.pl"&gt;added memory usage stats&lt;/a&gt; to Shawn (Sartak) Moore's &lt;a href="http://pastie.org/603698"&gt;original script&lt;/a&gt; which produced &lt;a href="http://tozt.net/uploads/text/times_with_mem"&gt;this data&lt;/a&gt; and then Cory (gphat) Watson used his &lt;a href="http://search.cpan.org/dist/Chart-Clicker/"&gt;Chart::Clicker&lt;/a&gt; module, which is written in Moose ;) to produce this graph:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_IhjVLbgZUmM/SqEN1B-4lzI/AAAAAAAAACI/FG9bPQ8HiI8/s1600-h/20090903-na1p2qmjt7xg5kmq2jsasmca72.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 177px;" src="http://4.bp.blogspot.com/_IhjVLbgZUmM/SqEN1B-4lzI/AAAAAAAAACI/FG9bPQ8HiI8/s400/20090903-na1p2qmjt7xg5kmq2jsasmca72.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5377594634773501746" /&gt;&lt;/a&gt;&lt;div&gt;The purple line is startup time and the yellow line is memory usage. (As I pointed out before, that nice downward drop at the very end there is a direct result of &lt;a href="http://blog.perlassociation.org/2009/07/jpa-sponsors-moose-class-mop-work.html"&gt;the Japan Perl Associations sponsorship of Goro Fuji&lt;/a&gt;). &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;The second step is to do something about it.&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A big part of the memory and CPU hit is from the meta-layer. These are all the objects that Moose has to create for your class, and then all the code Moose compiles and evals to make sure things are fast at runtime. This is largely a one-time (compile time) cost and if you never call the "meta" method on your Moose class then you never use it again. We currently have two projects going on to help reduce or even eliminate some of these costs.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A recent &lt;a href="http://blog.afoolishmanifesto.com/archives/1124"&gt;post by fREW Schmidt&lt;/a&gt; announced that he is currently working to refactor the Moose test suite in such a way that the meta-level tests are optional. This is to help make way for Matt Trout's proposed "&lt;a href="http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo/MooseX-Antlers.git;a=summary"&gt;Antlers&lt;/a&gt;" project, which aims to "compile" Moose classes such that the meta-layer (the part that consumes most of the memory and takes so much time at startup) is not loaded or used unless you actually specifically request it by calling the "meta" method itself. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This idea has been kicking around the Moose team's heads for a while, in fact it is an evolution/mutation of Yuval Kogman's &lt;a href="http://search.cpan.org/dist/MooseX-Compile/"&gt;MooseX::Compile&lt;/a&gt; module. When Yuval wrote his version over a year and a half ago, Moose did not have the proper features internally and so the project was shelved. Now we feel that Moose is ready, and with fREW's test suite refactoring, it should only be a matter of tuits before this can become a reality. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The second is a combination of Goro Fuji's work and some XS-ification that Yuval Kogman, Florian (rafl) Ragwitz and a few other Moose hackers have been doing. The aim of this is to eliminate much of the need to do the code evaling for accessor and constructor generation by moving them to XS. Since we don't want you to pay for any more features then your using, Moose currently will compile only as much accessor and constructor code as you need and eval it into existence (which gets expensive). It is the hope that by moving that code to XS we can eliminate the speed penalty of un-used features and therefore not need to custom compile anymore. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;The third step is to recruit new cult members.&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Actually I am not sure if that is the 3rd step or not, but it sounds good to me. So if you love Moose and have some spare tuits lying around, please come and help pick some low hanging fruits and make this a reality. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5205671691245928993-3237376613781709277?l=stevan-little.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stevan-little.blogspot.com/feeds/3237376613781709277/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stevan-little.blogspot.com/2009/09/re-re-re-moose-or-no-moose.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/3237376613781709277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/3237376613781709277'/><link rel='alternate' type='text/html' href='http://stevan-little.blogspot.com/2009/09/re-re-re-moose-or-no-moose.html' title='Re: Re: Re: Moose Or No Moose'/><author><name>Stevan Little</name><uri>http://www.blogger.com/profile/01804375611677923875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_IhjVLbgZUmM/SpasL5rYhvI/AAAAAAAAABM/rxnwCbK3NA8/S220/n584352672_3079.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_IhjVLbgZUmM/SqEN1B-4lzI/AAAAAAAAACI/FG9bPQ8HiI8/s72-c/20090903-na1p2qmjt7xg5kmq2jsasmca72.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5205671691245928993.post-2347913441421087180</id><published>2009-09-02T18:05:00.000-07:00</published><updated>2009-09-03T04:50:37.443-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='moose'/><category scheme='http://www.blogger.com/atom/ns#' term='mop'/><category scheme='http://www.blogger.com/atom/ns#' term='japan-perl-organization'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Moose Startup Time over Time</title><content type='html'>&lt;div&gt;I actually owe marcus an apology.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You were correct in that &lt;a href="http://stevan-little.blogspot.com/2009/09/re-re-moose-or-no-moose.html?showComment=1251919409095#c498105980906024838"&gt;Moose startup time has not gotten significantly faster since 0.01&lt;/a&gt;. After our exchange Sartak decided to actually take a look and see. So he wrote &lt;a href="http://pastie.org/603698"&gt;this script&lt;/a&gt;, which produced &lt;a href="http://sartak.org/tmp/moose-compile-times.txt"&gt;this data&lt;/a&gt;, which &lt;a href="http://headrattle.blogspot.com/search/label/perl"&gt;jhannah&lt;/a&gt; then promptly turned into &lt;a href="http://clab.ist.unomaha.edu/~jhannah/tmp/moose.png"&gt;this graph&lt;/a&gt; (reproduced below).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_IhjVLbgZUmM/Sp8XYKBvV7I/AAAAAAAAAB4/PuWSNYRJ4_4/s1600-h/moose.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 214px;" src="http://1.bp.blogspot.com/_IhjVLbgZUmM/Sp8XYKBvV7I/AAAAAAAAAB4/PuWSNYRJ4_4/s320/moose.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5377042183879612338" /&gt;&lt;/a&gt;&lt;div&gt;It seems that since the 0.15 release we have &lt;i&gt;mostly&lt;/i&gt;  stayed within the 0.2 to 0.3 second range. It is interesting to look at the Changelogs for both &lt;a href="http://search.cpan.org/src/DROLSKY/Moose-0.89/Changes"&gt;Moose&lt;/a&gt; and &lt;a href="http://search.cpan.org/src/DROLSKY/Class-MOP-0.92/Changes"&gt;Class::MOP&lt;/a&gt; you can actually see the feature additions or refactorings that correspond with the peaks and valleys. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Some of the most recent speedup is the direct result of &lt;a href="http://d.hatena.ne.jp/gfx/"&gt;Goro (gfx) Fuji's&lt;/a&gt; work on &lt;a href="http://cpansearch.perl.org/src/DROLSKY/Class-MOP-0.90/Changes"&gt;Class::MOP&lt;/a&gt; and Moose as &lt;a href="http://blog.perlassociation.org/2009/07/jpa-sponsors-moose-class-mop-work.html"&gt;sponsored&lt;/a&gt; by the &lt;a href="http://japan.perlassociation.org/"&gt;Japan Perl Association&lt;/a&gt;.  Much thanks to all involved in that.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span"  style="color:#551A8B;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5205671691245928993-2347913441421087180?l=stevan-little.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stevan-little.blogspot.com/feeds/2347913441421087180/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stevan-little.blogspot.com/2009/09/moose-startup-time-over-time_02.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/2347913441421087180'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/2347913441421087180'/><link rel='alternate' type='text/html' href='http://stevan-little.blogspot.com/2009/09/moose-startup-time-over-time_02.html' title='Moose Startup Time over Time'/><author><name>Stevan Little</name><uri>http://www.blogger.com/profile/01804375611677923875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_IhjVLbgZUmM/SpasL5rYhvI/AAAAAAAAABM/rxnwCbK3NA8/S220/n584352672_3079.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_IhjVLbgZUmM/Sp8XYKBvV7I/AAAAAAAAAB4/PuWSNYRJ4_4/s72-c/moose.jpg' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5205671691245928993.post-3597320536348950414</id><published>2009-09-02T04:27:00.000-07:00</published><updated>2009-09-02T08:12:45.777-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='moose'/><category scheme='http://www.blogger.com/atom/ns#' term='cpan'/><category scheme='http://www.blogger.com/atom/ns#' term='yapc'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Re: Re: Moose Or No Moose</title><content type='html'>&lt;a href="http://chris.prather.org/"&gt;Chris Prather&lt;/a&gt; recently asked "&lt;a href="http://chris.prather.org/perl/take-arms-against-a-sea-of-troubles/"&gt;who is generally complaining about the slings and arrows of outrageous dependencies&lt;/a&gt;", which got me thinking (and I will get back to that thought in a moment).&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://perlhacks.com/"&gt;Dave Cross&lt;/a&gt; also left a &lt;a href="http://stevan-little.blogspot.com/2009/09/re-moose-or-no-moose.html?showComment=1251882055106#c3900504688926841674"&gt;comment&lt;/a&gt; on my last blog post clarifying the relationship between his &lt;a href="http://search.cpan.org/dist/Array-Compare/"&gt;Array::Compare&lt;/a&gt; module and &lt;a href="http://search.cpan.org/dist/Test-Warn/"&gt;Test::Warn&lt;/a&gt;. Seems that the author of &lt;a href="http://search.cpan.org/dist/Test-Warn"&gt;Test::Warn&lt;/a&gt; actually &lt;a href="http://cpansearch.perl.org/src/CHORNY/Test-Warn-0.21/Changes"&gt;removed the usage of Array::Compare&lt;/a&gt; in a dev release several months ago, but simply forgot to remove it from the META.yml dependency listing.  While I still think it is important to look downstream before you port to &lt;a href="http://search.cpan.org/dist/Moose"&gt;Moose&lt;/a&gt;, this clarification got me thinking as well.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Next comes &lt;a href="http://blog.jrock.us/"&gt;Jonathan Rockway&lt;/a&gt; and his &lt;a href="http://blog.jrock.us/tags/emacs"&gt;emacs fetish&lt;/a&gt;. Jonathan left a &lt;a href="http://perlhacks.com/2009/09/moose-or-no-moose.php#comment-36"&gt;comment&lt;/a&gt; on Dave's blog which if you didn't know Jonathan, might be mistaken for an attempt to ignite the eternal Emacs vs. VI flamewar. But if you look beyond the emacs fanboi-ness of the comment you will see that Jonathan is (as usual) really making an excellent point about &lt;a href="http://search.cpan.org/dist/Padre"&gt;Padre&lt;/a&gt;, its extensibility as an editor, its dependencies and the choices its authors are making in relation to those things. This got me thinking about what &lt;a href="http://search.cpan.org/dist/Moose"&gt;Moose&lt;/a&gt; might be able to bring to the &lt;a href="http://search.cpan.org/dist/Padre"&gt;Parde&lt;/a&gt; party, good or bad. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So, now for my thoughts ...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To answer Chris's question, there are at least the two people who commented in the RT bug. The first is Adam Kennedy, who loves all things fast and tiny and has long complained about &lt;a href="http://search.cpan.org/dist/Moose"&gt;Moose&lt;/a&gt;'s appetite for CPU and memory. And the second is &lt;a href="http://mark.stosberg.com/blog/index.html"&gt;Mark Stosberg&lt;/a&gt; who is a big advocate of &lt;a href="http://mark.stosberg.com/blog/2008/11/the-benefits-of-vanilla-cgi-vs-fastcgi-for-perl-apps.html"&gt;vanilla CGI&lt;/a&gt; on which &lt;a href="http://mark.stosberg.com/blog/2008/11/startup-benchmarks-for-mojo-catalyst-titanium-httpengine-and-cgiapplication.html"&gt;he and I have long disagreed&lt;/a&gt;. It is not surprising that neither of them like &lt;a href="http://search.cpan.org/dist/Moose"&gt;Moose&lt;/a&gt;. Are they representative of some kind of majority? Or just religious extremists worshipping at the altar of slim computing? It is hard to say, they both have valid concerns, but history and trends are pretty clear in how bloated software and ever improving hardware are constantly pushing one another forward (Moore's Law FTW). &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So, &lt;a href="http://stevan-little.blogspot.com/2009/09/re-moose-or-no-moose.html"&gt;as I said before&lt;/a&gt;, I agree-to-disagree with Adam and on his points, but the more I think about it, I think perhaps he is just knee-jerking here and possibly even using RT in anger. In the RT bug he says&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="  ;font-family:'Andale Mono', monospace;font-size:10px;"&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;This adds a huge amount of additional dependencie&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;s&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Now sure this is true in relation to &lt;a href="http://search.cpan.org/dist/Array-Compare/"&gt;Array::Compare&lt;/a&gt;, but we all know that Adam is really talking about &lt;a href="http://search.cpan.org/dist/Padre"&gt;Padre&lt;/a&gt;. This is a little ridiculous considering &lt;a href="http://search.cpan.org/dist/Moose"&gt;Moose&lt;/a&gt; (on 5.10.0) has only &lt;a href="http://deps.cpantesters.org/?module=Moose&amp;amp;perl=5.10.0&amp;amp;os=any+OS"&gt;21 depenencies, 6 of which are core modules and has a 92% chance of installing (it would be 100%, but List::MoreUtils is dragging us down)&lt;/a&gt;. While &lt;a href="http://search.cpan.org/dist/Padre"&gt;Padre&lt;/a&gt; (also on 5.10.0) has &lt;a href="http://deps.cpantesters.org/?module=Padre&amp;amp;perl=5.10.0&amp;amp;os=any+OS"&gt;104 dependencies, 32 of which are core modules and only has a 24% chance of installing&lt;/a&gt; (and &lt;a href="http://img.skitch.com/20090902-gma7q8mh7p82rp97hre14tawx9.jpg"&gt;requires a threaded Perl as well&lt;/a&gt;). So really how many dependencies would &lt;a href="http://search.cpan.org/dist/Moose"&gt;Moose&lt;/a&gt; add to &lt;a href="http://search.cpan.org/dist/Padre"&gt;Padre&lt;/a&gt;? Of the non-core dependencies they share 5 dependencies, so 21 - 6 core - 5 shared = 10, which when added to &lt;a href="http://search.cpan.org/dist/Padre"&gt;Padre&lt;/a&gt;'s 62 non-core deps brings the grand total to 72. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now, you might say "Wait a minute, thats a non-trivial amount of additional dependencies", and in fact you would be correct. However, the likelyhood that &lt;a href="http://search.cpan.org/dist/Moose"&gt;Moose&lt;/a&gt; is already installed is fairly high and growing by the day as it's &lt;a href="http://cpants.perl.org/dist/used_by/Moose"&gt;popularity increases&lt;/a&gt; and already popular modules like &lt;a href="http://search.cpan.org/dist/Catalyst-Runtime"&gt;Catalyst&lt;/a&gt; start using it. You see, &lt;a href="http://search.cpan.org/dist/Moose"&gt;Moose&lt;/a&gt; is not like other CPAN modules which simply provide a specific feature for a specific need, but instead is a tool to extend the language itself and which you use to create other CPAN modules. Because of this, the chance of having &lt;a href="http://search.cpan.org/dist/Moose"&gt;Moose&lt;/a&gt; already installed, either directly or because you install &lt;a href="http://cpants.perl.org/dist/used_by/Moose"&gt;one of the approximately 600+ modules&lt;/a&gt; that use it, is pretty high.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Adam's next point about startup time is valid, this has long been an issue with &lt;a href="http://search.cpan.org/dist/Moose"&gt;Moose&lt;/a&gt;. We have made great strides on this issue over the years, but there is still a ways to go. How much this truly affects &lt;a href="http://search.cpan.org/dist/Padre"&gt;Padre&lt;/a&gt; though is debatable, as Jonathan Rockway pointed out, how many times a day/week/month are you really going to be starting up your text editor? Is startup time for a featureful IDE with possibly many plugins really that big of a deal? It certainly hasn't seemed to slow down the adoption for things like Eclipse. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And finally, to Adam's last comment ...&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="  ;font-family:'Andale Mono', monospace;font-size:10px;"&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;If this can't be fixed, we're going to need to remove Array::Compare (and everything that uses it) from Padre&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;this was actually the part that concerned me most because of what Adam is saying to all the authors of &lt;a href="http://search.cpan.org/dist/Padre"&gt;Padre&lt;/a&gt;'s &lt;a href="http://deps.cpantesters.org/?module=Padre&amp;amp;perl=5.10.0&amp;amp;os=any+OS"&gt;62 non-core dependencies&lt;/a&gt;. While I do believe CPAN developers should look downstream before adding dependencies in the spirit of being a good neighbor, I think it is a little unreasonable for those upstream to dictate what is and is not an acceptable dependency. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Sure Dave's &lt;a href="http://search.cpan.org/dist/Array-Compare/"&gt;Array::Compare&lt;/a&gt; is a straightforward module and the benefits &lt;a href="http://search.cpan.org/dist/Moose"&gt;Moose&lt;/a&gt; brought to it were fairly minimal. But there are some pretty complex modules in &lt;a href="http://search.cpan.org/dist/Padre"&gt;Padre&lt;/a&gt;'s dependency list, many of which could probably benefit greatly from &lt;a href="http://search.cpan.org/dist/Moose"&gt;Moose&lt;/a&gt;.  And what about &lt;a href="http://search.cpan.org/dist/Padre"&gt;Padre&lt;/a&gt; plugins? Are they allowed to use &lt;a href="http://search.cpan.org/dist/Moose"&gt;Moose&lt;/a&gt;? What if they become popular plugins and the &lt;a href="http://search.cpan.org/dist/Padre"&gt;Padre&lt;/a&gt; folks want to merge them into the core? Do they have to shed the &lt;a href="http://search.cpan.org/dist/Moose"&gt;Moose&lt;/a&gt; before being allowed in? Where does this insanity end!?!?!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;See, &lt;a href="http://search.cpan.org/dist/Moose"&gt;Moose&lt;/a&gt; is growing in popularity a lot lately. The number of &lt;a href="http://cpants.perl.org/dist/used_by/Moose"&gt;CPAN modules that use Moose&lt;/a&gt; have been growing at a very steady pace. The #moose@irc.perl.org channel regularly has &lt;a href="http://img.skitch.com/20090902-rec4q8hg5ywbcsexqm5snxfd2c.jpg"&gt;over 200 people&lt;/a&gt; in it. If you read the &lt;a href="http://ironman.enlightenedperl.org/"&gt;Perl Ironman&lt;/a&gt; blogs, you have no doubt seen a lot of &lt;a href="http://search.cpan.org/dist/Moose"&gt;Moose&lt;/a&gt; there lately. The number of &lt;a href="http://www.perlmonks.org/index.pl?node_id=3989;BIT=Moose"&gt;Moose related questions on Perlmonks&lt;/a&gt; has been increasing lately (I should know I answer many of them). There were &lt;a href="http://yapc10.org/yn2009/talks/tag/moose"&gt;16 talks at YAPC::NA this year tagged with Moose&lt;/a&gt; (including a &lt;a href="http://yapc10.org/yn2009/talk/2047"&gt;6 hour Moose course&lt;/a&gt;)  which made &lt;a href="http://yapc10.org/yn2009/talks/"&gt;Moose one of the largest tags in the cloud&lt;/a&gt;. This was followed by &lt;a href="http://yapceurope2009.org/ye2009/talks/tag/moose"&gt;7 talks at YAPC::EU&lt;/a&gt; this year.There will be &lt;a href="http://conferences.yapcasia.org/ya2009/"&gt;approx 5 or so talks at the upcoming YAPC::Asia&lt;/a&gt; (including the &lt;a href="http://conferences.yapcasia.org/ya2009/talk/2192"&gt;Moose course&lt;/a&gt; again given by &lt;a href="http://blog.sartak.org/"&gt;Sartak&lt;/a&gt;). &lt;a href="http://blog.urth.org/"&gt;Dave Rolsky&lt;/a&gt; will be giving a &lt;a href="http://conferences.yapceurope.org/ipw2009/talk/2257"&gt;Moose course&lt;/a&gt; at the &lt;a href="http://conferences.yapceurope.org/ipw2009/"&gt;Italian Perl Workshop&lt;/a&gt;. &lt;a href="http://search.cpan.org/dist/Moose"&gt;Moose&lt;/a&gt; is also central to the &lt;a href="http://www.enlightenedperl.org/"&gt;EPO&lt;/a&gt;'s &lt;a href="http://www.enlightenedperl.org/extendedcore.html"&gt;extended core effor&lt;/a&gt;t. We even get a fair amount of &lt;a href="http://search.twitter.com/search?q=moose+perl"&gt;twitter traffic&lt;/a&gt; (for whatever that is worth). &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Because of this, I really think &lt;a href="http://search.cpan.org/dist/Moose"&gt;Moose&lt;/a&gt; has proved itself not to be just a fad, especially considering this momentum has been steadily growing over &lt;a href="http://search.cpan.org/~stevan/Moose-0.01/"&gt;3 and a half years&lt;/a&gt; now. While it might be reasonable of Adam to request upstream deps not use &lt;a href="http://search.cpan.org/dist/Moose"&gt;Moose&lt;/a&gt; right now,  how much longer before this becomes a real problem for &lt;a href="http://search.cpan.org/dist/Padre"&gt;Padre&lt;/a&gt;?  Will the culture of &lt;a href="http://en.wikipedia.org/wiki/Not_Invented_Here"&gt;NIH&lt;/a&gt; set in? Should &lt;a href="http://search.cpan.org/dist/Padre"&gt;Padre&lt;/a&gt; embrace the &lt;a href="http://search.cpan.org/dist/Moose"&gt;Moose&lt;/a&gt; future now?  Has anyone even benchmarked/profiled how much of an impact &lt;a href="http://search.cpan.org/dist/Moose"&gt;Moose&lt;/a&gt; would have on &lt;a href="http://search.cpan.org/dist/Padre"&gt;Padre&lt;/a&gt;? &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So Internets, what do you think?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5205671691245928993-3597320536348950414?l=stevan-little.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stevan-little.blogspot.com/feeds/3597320536348950414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stevan-little.blogspot.com/2009/09/re-re-moose-or-no-moose.html#comment-form' title='16 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/3597320536348950414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/3597320536348950414'/><link rel='alternate' type='text/html' href='http://stevan-little.blogspot.com/2009/09/re-re-moose-or-no-moose.html' title='Re: Re: Moose Or No Moose'/><author><name>Stevan Little</name><uri>http://www.blogger.com/profile/01804375611677923875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_IhjVLbgZUmM/SpasL5rYhvI/AAAAAAAAABM/rxnwCbK3NA8/S220/n584352672_3079.jpg'/></author><thr:total>16</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5205671691245928993.post-8544001082733213650</id><published>2009-09-01T14:23:00.000-07:00</published><updated>2009-09-01T15:45:59.209-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='moose'/><category scheme='http://www.blogger.com/atom/ns#' term='cpan'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Re: Moose Or No Moose</title><content type='html'>Moose love controversy, in fact you could say that they are natures attention &lt;a href="http://www.zazzle.com/will_do_moose_stuff_for_money_tshirt-235711083720262006"&gt;whores&lt;/a&gt; (second only to those nasty hairless apes that seem to be everywhere!). If they aren't &lt;a href="http://www.thatguitarman.com/images/palin-moose1.jpg"&gt;endorsing controversial politicians&lt;/a&gt;, having &lt;a href="http://adamant.typepad.com/.a/6a00d83451b13569e2010534e4905e970c-800wi"&gt;kinky&lt;/a&gt; &lt;a href="http://www.documentingreality.com/forum/attachments/f3/14447d1192988576-moose-trying-hump-statue-moose-humping-statue..jpg"&gt;sex&lt;/a&gt; or &lt;a href="http://justsickshit.com/wp-content/uploads/2007/10/moose-car-accident-2.jpg"&gt;crashing expensive cars&lt;/a&gt; then you can likely find them &lt;a href="http://cache.gizmodo.com/assets/resources/2008/03/mooseblaster.jpg"&gt;partying all night at the hottest clubs&lt;/a&gt;. And of course all this attention leads not only to a lot of &lt;a href="http://www.jonco48.com/blog/moose.jpg"&gt;imitation&lt;/a&gt; but even some &lt;a href="http://www.strictlybowhunting.com/Anov01issue/images/jon_moose.JPG"&gt;haters&lt;/a&gt;.   &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The same can be said of the &lt;a href="http://moose.perl.org"&gt;Moose&lt;/a&gt; perl module (well, the controversy part anyway, modules can't have sex or drive cars, DUH!). The latest controversy is surrounding a &lt;a href="http://perlhacks.com/2009/09/moose-or-no-moose.php"&gt;blog post&lt;/a&gt; by David Cross in which he tells the story of a &lt;a href="http://rt.cpan.org/Public/Bug/Display.html?id=49270"&gt;RT "bug" report&lt;/a&gt; he got after porting his &lt;a href="http://search.cpan.org/dist/Array-Compare/"&gt;Array::Compare&lt;/a&gt; module to Moose. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The bug report was submitted by &lt;a href="http://use.perl.org/~Alias/journal/"&gt;Adam Kennedy&lt;/a&gt; who has a well known &lt;a href="http://search.cpan.org/dist/DateTime-Tiny/"&gt;fetish&lt;/a&gt; &lt;a href="http://search.cpan.org/dist/CSS-Tiny/"&gt;for&lt;/a&gt; &lt;a href="http://search.cpan.org/dist/Config-Tiny/"&gt;all&lt;/a&gt; &lt;a href="http://search.cpan.org/dist/YAML-Tiny/"&gt;things&lt;/a&gt; &lt;a href="http://search.cpan.org/dist/Object-Tiny/"&gt;tiny&lt;/a&gt;. While I do not share Adam's love for CPU/Memory conservation, I do respect his efforts in trying to keep some of the critical tools of our beloved Perl infrastructure slim and easily installable. And in fact, in this case I do have to agree with Adam, before you port an existing module to Moose it helps to &lt;a href="http://cpants.perl.org/dist/used_by/"&gt;look downstream a little&lt;/a&gt;. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The benefits Moose provides for a module as straightforward as &lt;a href="http://search.cpan.org/dist/Array-Compare/"&gt;Array::Compare&lt;/a&gt; are actually pretty minimal, it is only using a few simple attributes and not much more. But Moose does come with a well known startup cost (don't let the haters tell you we are slow, once we get up and running things are plenty fast enough and getting faster), which Array::Compare was passing onto &lt;a href="http://cpants.perl.org/dist/used_by/Array-Compare"&gt;all its dependencies&lt;/a&gt;. One of those (now former) dependencies was &lt;a href="http://search.cpan.org/~chorny/Test-Warn-0.11/"&gt;Test::Warn&lt;/a&gt; which itself has &lt;a href="http://cpants.perl.org/dist/used_by/Test-Warn"&gt;101 modules&lt;/a&gt; that in turn depend on it in their test suites. The result is that this simple change with minimal overall benefits has imposed a cost on a &lt;a href="http://cpan-explorer.org/category/distributions/#dist%3DTest-Warn"&gt;sizable chunk of the CPAN&lt;/a&gt;. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now you could argue that &lt;a href="http://padre.perlide.org/"&gt;Padre - The Perl IDE&lt;/a&gt; (the project that initially sparked all this) is an IDE and like other IDEs  (Eclipse, Visual Studio, etc) it should take forever to start up so as to allow developers a leisurely morning coffee break. Or you could argue that it is Dave's module and he can do whatever he wants with it, downstream dependencies be damned. You could even say that Moose will eventually be &lt;a href="http://blog.woobling.org/2009/07/optimizing-mooses-startup.html"&gt;fast enough&lt;/a&gt; so people should stop whining and just be patient. But in the end, we (CPAN) are a &lt;a href="http://cpan-explorer.org/"&gt;large and heavily interdependent community&lt;/a&gt; and I believe we should be respectful to our neighbors as much as possible. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Anyway, Nuff Said,... Peace out to all mah homeys attending &lt;a href="http://conferences.yapcasia.org/ya2009/"&gt;YAPC::Asia&lt;/a&gt;, wish I could have come this year.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5205671691245928993-8544001082733213650?l=stevan-little.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stevan-little.blogspot.com/feeds/8544001082733213650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stevan-little.blogspot.com/2009/09/re-moose-or-no-moose.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/8544001082733213650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/8544001082733213650'/><link rel='alternate' type='text/html' href='http://stevan-little.blogspot.com/2009/09/re-moose-or-no-moose.html' title='Re: Moose Or No Moose'/><author><name>Stevan Little</name><uri>http://www.blogger.com/profile/01804375611677923875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_IhjVLbgZUmM/SpasL5rYhvI/AAAAAAAAABM/rxnwCbK3NA8/S220/n584352672_3079.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5205671691245928993.post-2221272982701983040</id><published>2009-08-27T08:30:00.000-07:00</published><updated>2009-08-27T08:53:14.412-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='moose'/><category scheme='http://www.blogger.com/atom/ns#' term='cpan'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Rollin' like a Moose-flavored steamroller!</title><content type='html'>So &lt;a href="http://chris.prather.org/"&gt;Chris Prather&lt;/a&gt; pointed out Adam Kennedy's latest &lt;a href="http://ali.as/top100/"&gt;CPAN Top 100&lt;/a&gt; data to me and noted that Moose now has more downstream dependencies (see the "Volatile 100" tab) then DBI does (we have 1032 compared to DBI's 977). Now of course, DBI is a much more widely used module out in the DarkPAN and I harbor no delusions about what this comparison really means. However, Moose is growing like crazy the last few months and while we still don't have as many downstream dependencies as Class::Accessor (they have 1694, so just 662 left to go) we did recently surpass them on direct dependencies (&lt;a href="http://cpants.perl.org/dist/used_by/Moose"&gt;Moose&lt;/a&gt; has 591 and &lt;a href="http://cpants.perl.org/dist/used_by/Class-Accessor"&gt;C::A&lt;/a&gt; has 567). And looking over the list of authors of these Class::Accessor modules I do see a &lt;i&gt;lot&lt;/i&gt; of known Moose conspirators.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; It seems I have created a monster :)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5205671691245928993-2221272982701983040?l=stevan-little.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stevan-little.blogspot.com/feeds/2221272982701983040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stevan-little.blogspot.com/2009/08/rollin-like-moose-flavored-steamroller.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/2221272982701983040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/2221272982701983040'/><link rel='alternate' type='text/html' href='http://stevan-little.blogspot.com/2009/08/rollin-like-moose-flavored-steamroller.html' title='Rollin&apos; like a Moose-flavored steamroller!'/><author><name>Stevan Little</name><uri>http://www.blogger.com/profile/01804375611677923875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_IhjVLbgZUmM/SpasL5rYhvI/AAAAAAAAABM/rxnwCbK3NA8/S220/n584352672_3079.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5205671691245928993.post-8015959843162631047</id><published>2009-07-28T17:13:00.000-07:00</published><updated>2009-07-28T17:53:47.216-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='leaks'/><category scheme='http://www.blogger.com/atom/ns#' term='plumbing'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Plumbing 101 - Fixing my leaky Intertubes</title><content type='html'>So this will be a short one, but I promised &lt;a href="http://blog.woobling.org/"&gt;Yuval&lt;/a&gt; I would write it up.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;My recent big refactoring project at work has been largely about switching a mad-cap collection of YAML config files, database tables, poorly inferred relationships and other sorts of random insanity that accumulates over 5 years of maintaining and extending an application, and inverting this unmaintainable mess into a nice clean happy &lt;a href="http://iinteractive.com/kiokudb/"&gt;KiokuDB&lt;/a&gt; based set of objects.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So all is going well until the other day when I upped the number of FCGI backends and the concurrency exposed  a leak in my objects which was not visible when using only the 1 FCGI backend for development. So the first thing I did was to turn to my unit tests and see if I could detect the leak outside of my web-app using &lt;a href="http://search.cpan.org/dist/Test-Memory-Cycle/"&gt;Test::Memory::Cycle&lt;/a&gt;. Of course I didn't find one there, that would have been too easy, it was buried deeper inside the web-app. So I then enlisted Yuval for help since his knowledge of the Perl guts far exceeds what mine will ever be. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Unfortunately for me, this application pre-dates Catalyst so I could not use &lt;a href="http://search.cpan.org/dist/Catalyst-Model-KiokuDB/"&gt;Catalyst::Model::KiokuDB&lt;/a&gt;, but I was able to cargo-cult the core of that module and stuff it into the homegrown web framework that this did run on. So while this didn't solve the problem it did allow me to watch the problem happen and gather nice statistics.  I can't stress how important it is to get the your monitoring tools set up first so your not digging through false positives and/or useless information. Yuval and I spent a fair amount of time tweaking this until we finally found the right settings that gave us the perfect balance of information. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After this it was a lot of playing around with &lt;a href="http://search.cpan.org/dist/Devel-FindRef/"&gt;Devel::FindRef&lt;/a&gt; and &lt;a href="http://search.cpan.org/dist/Scalar-List-Utils/"&gt;Scalar::Util::weaken&lt;/a&gt; until I found the right settings and all my leaks were gone. One particularly evil leak was closures passed into Template::Toolkit params that referenced themselves inside the closure. This resulted in the entire template object leaking, including all associated parameters (in one case this meant hundred of objects). I realized as I was fixing this, that this leak (and a few others) had existed for probably the entire 5 years this application has been running. Only now that it was leaking &lt;a href="http://iinteractive.com/kiokudb/"&gt;KiokuDB&lt;/a&gt; objects and causing visible issues did I actually notice. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So while I don't feel that I am now some kind of Master Plumber or anything, I do feel confident enough to fix a leaky intertube here or there. And as always I am amazed by the flexibility of Perl and the wonders that CPAN provides.  It is an odd combination of pride and shame to have finally cleaned up 5 year old leaks. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Anyway, back to work ...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5205671691245928993-8015959843162631047?l=stevan-little.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stevan-little.blogspot.com/feeds/8015959843162631047/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stevan-little.blogspot.com/2009/07/plumbing-101-fixing-my-leaky-intertubes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/8015959843162631047'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/8015959843162631047'/><link rel='alternate' type='text/html' href='http://stevan-little.blogspot.com/2009/07/plumbing-101-fixing-my-leaky-intertubes.html' title='Plumbing 101 - Fixing my leaky Intertubes'/><author><name>Stevan Little</name><uri>http://www.blogger.com/profile/01804375611677923875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_IhjVLbgZUmM/SpasL5rYhvI/AAAAAAAAABM/rxnwCbK3NA8/S220/n584352672_3079.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5205671691245928993.post-7980874995863229251</id><published>2009-07-16T10:39:00.000-07:00</published><updated>2009-07-16T11:59:23.383-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='moose'/><category scheme='http://www.blogger.com/atom/ns#' term='mop'/><category scheme='http://www.blogger.com/atom/ns#' term='roles'/><category scheme='http://www.blogger.com/atom/ns#' term='parameterized-roles'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><category scheme='http://www.blogger.com/atom/ns#' term='oop'/><title type='text'>More Thoughts on Parameterized Roles</title><content type='html'>So my &lt;a href="http://stevan-little.blogspot.com/2009/07/thoughts-on-parameterized-roles.html"&gt;last post&lt;/a&gt; on parameterized roles has really got me thinking. One of the first use cases I ran into for parameterized roles was &lt;a href="http://search.cpan.org/dist/MooseX-Storage/"&gt;MooseX::Storage&lt;/a&gt;. Myself and &lt;a href="http://chris.prather.org/"&gt;Chris Prather&lt;/a&gt; wrote it on the train into NYC one day and since there was no such thing as &lt;a href="http://search.cpan.org/dist/MooseX-Role-Parameterized/"&gt;MooseX::Role::Parameterized&lt;/a&gt; yet we hacked it with an exported &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Storage&lt;/span&gt; subroutine which composing in multiple roles based on the parameters that were passed to it. This is actually still how &lt;a href="http://search.cpan.org/dist/MooseX-Storage/"&gt;MooseX::Storage&lt;/a&gt; works because, well, it Just Works &lt;sup&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;tm&lt;/span&gt;&lt;/sup&gt; so there is no need to change it. But I decided as a thought experiment and a test of the Role Functor idea from my last post to see if I could re-write &lt;a href="http://search.cpan.org/dist/MooseX-Storage/"&gt;MooseX::Storage&lt;/a&gt; in terms of it. Much to my delight it not only worked, but came out very cleanly. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now, this is still written in &lt;a href="http://search.cpan.org/dist/MooseX-Declare/"&gt;MooseX::Declare&lt;/a&gt; inspired pseudo-code, so it is not yet a reality, but I am getting more and more convinced that this is something I really need to write. So anyway, here goes.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" ;font-family:'courier new';"&gt;role COLLAPSER { requires 'pack', 'unpack' }&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;role FORMATTER { requires 'thaw', 'freeze' }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;role IO        { requires 'load', 'store'  }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;role DefaultCollapser with COLLAPSER {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    method pack {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        Collapser::Engine-&gt;new( object =&gt; $self )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;                         -&gt;collapse_object&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    method unpack ($class:, $data) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        Collapser::Engine-&gt;new( class =&gt; $class )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;                         -&gt;expand_object( $data )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;role JSONFormatter [ &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        Collapser =&gt; (does =&gt; COLLAPSER) &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    ] with FORMATTER {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    method thaw ($class:, $json) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        $class-&gt;unpack( JSON::Any-&gt;encode( $json ) )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    method freeze {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        JSON::Any-&gt;decode( $self-&gt;pack )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;role SimpleFile [ &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        Formatter =&gt; (does =&gt; FORMATTER) &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    ] with IO {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    method load ($class:, $filename){&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        my $fh   = IO::File-&gt;new( $filename, 'r' );&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        my $data = do { local $/; &lt;$fh&gt;; };&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        $class-&gt;thaw( $data );&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    method store ($filename) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        my $fh = IO::File-&gt;new( $filename, 'w' );&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        $fh-&gt;print( $self-&gt;freeze );&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I am obviously punting on a couple of details here to keep things simple for the example, but I think it gets the point across.  The nice part, in my opinion, is that the parameterization nicely captures the "levels" of serialization. For instance, here is what a class that does all the options would look like:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;class Point &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; with SimpleFile( &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          Formatter =&gt; JSONFormatter( &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;              Collapser =&gt; DefaultCollapser &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;         ) &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    ) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    has x =&gt; (is =&gt; rw, isa =&gt; Int, default =&gt; 0);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    has y =&gt; (is =&gt; rw, isa =&gt; Int, default =&gt; 0);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    method clear {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        $self-&gt;x(0);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        $self-&gt;y(0);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And here is a class which does not do the load/store but just does the JSON freeze/thaw:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;class Point&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style=" ;font-family:Georgia;"&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" ;font-family:'courier new';"&gt; with JSONFormatter( &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" ;font-family:'courier new';"&gt;          Collapser =&gt; DefaultCollapser &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" ;font-family:'courier new';"&gt;    ) {&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    has x =&gt; (is =&gt; rw, isa =&gt; Int, default =&gt; 0);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    has y =&gt; (is =&gt; rw, isa =&gt; Int, default =&gt; 0);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    method clear {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        $self-&gt;x(0);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        $self-&gt;y(0);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And here is a class which does only the simple pack/unpack:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;class Point with DefaultCollapser {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    has x =&gt; (is =&gt; rw, isa =&gt; Int, default =&gt; 0);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    has y =&gt; (is =&gt; rw, isa =&gt; Int, default =&gt; 0);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    method clear {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        $self-&gt;x(0);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        $self-&gt;y(0);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Overall I am quite happy with this, so now it is just a matter of finding the tuits to actually implement it.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5205671691245928993-7980874995863229251?l=stevan-little.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stevan-little.blogspot.com/feeds/7980874995863229251/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stevan-little.blogspot.com/2009/07/more-thoughts-on-parameterized-roles.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/7980874995863229251'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/7980874995863229251'/><link rel='alternate' type='text/html' href='http://stevan-little.blogspot.com/2009/07/more-thoughts-on-parameterized-roles.html' title='More Thoughts on Parameterized Roles'/><author><name>Stevan Little</name><uri>http://www.blogger.com/profile/01804375611677923875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_IhjVLbgZUmM/SpasL5rYhvI/AAAAAAAAABM/rxnwCbK3NA8/S220/n584352672_3079.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5205671691245928993.post-7911601326100633352</id><published>2009-07-12T15:45:00.000-07:00</published><updated>2009-07-14T05:57:07.062-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='moose'/><category scheme='http://www.blogger.com/atom/ns#' term='roles'/><category scheme='http://www.blogger.com/atom/ns#' term='parameterized-roles'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><category scheme='http://www.blogger.com/atom/ns#' term='oop'/><title type='text'>Thoughts on Parameterized Roles</title><content type='html'>I was discussing parameterized roles with Sartak and doy at YAPC::NA this year. Sartak is the author of the very cool &lt;a href="http://search.cpan.org/dist/MooseX-Role-Parameterized/"&gt;MooseX::Role::Parameterized&lt;/a&gt; module, which implements pretty much unlimited parameterization abilities for roles. The shear, unbridled flexibility embodied in that module is insane, which, of course, is both really cool and really scary at the same time. One of our discussion points was about how so much flexibility, if misused, pretty much destroys the benefits of allomorphism you get from roles. With enough parameterization the statement &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;$object-&gt;does(SomeRole)&lt;/span&gt; has very little meaning anymore since SomeRole could easily be parameterized so that two instances of it do wildly different things. One of the thoughts discussed for solving this problem was to create a stricter set of different kinds of parameters that are allowed. Essentially restricting the functionality to a sane subset through which we can provide some level of guaranteed allomorphism.  While we pretty much rejected that idea for &lt;a href="http://search.cpan.org/dist/MooseX-Role-Parameterized/"&gt;MooseX::Role::Parameterized&lt;/a&gt;, the idea stuck in my head.&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So the other day on #moose, I was discussing parameterized roles again with Sartak and doy and I mentioned how I have always seen parameterized roles as being very close to ML Functors. The ML family of languages (Standard ML , OCaml, etc.) has an extremely powerful module system which not only has modules (structure in SML) and module signatures (the "type" of the module) but also functors. Functors are best described as modules which take another module as an argument and produce a third module as a result. The book "ML for the Working Programmer" (highly recommended, it is a great book) shows the following conceptual mapping to try and help describe the ML module system. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  structure ~ value&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  signature ~ type&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    functor ~ function&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But as the book says, this is a helpful starting point, but it fails to convey the full possibilities of the ML module system. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So at one point in this discussion I decided to try and sketch out how Functor-esque parameterized roles might look and I came up with this (using MooseX::Declare inspired pseudo-code).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;role ORDERING { requires 'compare' }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;role Sortable [Ordering =&gt; (does =&gt; 'ORDERING') ] {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    sub sort {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        my ($self, @elements)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        sort { $self-&gt;compare($a, $b) } @elements&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;role StringOrder with ORDERING {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    sub compare {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        my (undef, $x, $y) = @_;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        $x cmp $y;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;role NumericOrder with ORDERING {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    sub compare {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        my (undef, $x, $y) = @_;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        $x &lt;=&gt; $y;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;role AlphabeticalOrder with ORDERING {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    sub compare {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        my (undef, $x, $y) = @_;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        lc($x) cmp lc($y);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;class BunchOfStrings with Sortable(StringOrder) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    # ...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;class BunchOfNumbers with Sortable(NumericOrder) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    # ...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;The first role &lt;span class="Apple-style-span" style="font-style: italic;"&gt;ORDERING&lt;/span&gt; is just an role that requires the &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;compare&lt;/span&gt; method and nothing more (an interface), which maps to the ML idea of a signature. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The second is the parameterized role &lt;span class="Apple-style-span" style="font-style: italic;"&gt;Sortable&lt;/span&gt; which implements a sort method and expects a single role parameter &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Ordering&lt;/span&gt; which must be a role that does the &lt;span class="Apple-style-span" style="font-style: italic;"&gt;ORDERING&lt;/span&gt; interface. This role maps to the ML idea of a Functor. If you notice the &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Sortable::sort&lt;/span&gt; method calls a &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;compare&lt;/span&gt; method, which is a method of the &lt;span class="Apple-style-span" style="font-style: italic;"&gt;ORDERING&lt;/span&gt; interface role. The idea here is that the role provided in the parameter &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Ordering&lt;/span&gt; will get composed into the &lt;span class="Apple-style-span" style="font-style: italic;"&gt;Sortable&lt;/span&gt; role and provide the expected &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;compare&lt;/span&gt; method. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The next three roles are just examples of roles that do the &lt;span class="Apple-style-span" style="font-style: italic;"&gt;ORDERING&lt;/span&gt; interface role. Basically one for each of the most common Perl sorting behaviors (at least the most common in my experience). These are pretty simple and straightforward, nothing special here.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After this is a few classes that show how this mechanism might get used. The &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Sortable(StringOrder)&lt;/span&gt; &lt;span class="Apple-style-span"  style=" ;font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style=" ;font-family:Georgia;"&gt;syntax shows the passing of the role parameter (in this case &lt;span class="Apple-style-span"  style=" ;font-family:'courier new';"&gt;StringOrder&lt;span class="Apple-style-span"  style=" ;font-family:Georgia;"&gt;) to the parameterized role &lt;span class="Apple-style-span"  style=" ;font-family:'courier new';"&gt;Sortable&lt;span class="Apple-style-span"  style=" ;font-family:Georgia;"&gt;. The result of this will produce a third role which is then composed into the &lt;/span&gt;BunchOfStrings&lt;span class="Apple-style-span"  style=" ;font-family:Georgia;"&gt; class.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So, while this is much more restrictive then &lt;a href="http://search.cpan.org/dist/MooseX-Role-Parameterized/"&gt;MooseX::Role::Parameterized&lt;/a&gt;, it is much more flexible then simply creating a restricted subset of parameterizable bits. It also (perhaps) solves the allomorphism issue since the "name" of the &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Sortable(StringOrder)&lt;/span&gt; role is simply &lt;span class="Apple-style-span" style="font-style: italic;"&gt;Sortable(StringOrder)&lt;/span&gt; and this clearly provides a predictable and repeatable set of functionality.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So anyway, I do not currently have the tuits to implement this and honestly I kind of want to let this stew for a little longer. It would &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;not&lt;/span&gt; replace &lt;a href="http://search.cpan.org/dist/MooseX-Role-Parameterized/"&gt;MooseX::Role::Parameterized&lt;/a&gt; but perhaps be called MooseX::Role::Functors or something and can be just another way to do it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5205671691245928993-7911601326100633352?l=stevan-little.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stevan-little.blogspot.com/feeds/7911601326100633352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stevan-little.blogspot.com/2009/07/thoughts-on-parameterized-roles.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/7911601326100633352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/7911601326100633352'/><link rel='alternate' type='text/html' href='http://stevan-little.blogspot.com/2009/07/thoughts-on-parameterized-roles.html' title='Thoughts on Parameterized Roles'/><author><name>Stevan Little</name><uri>http://www.blogger.com/profile/01804375611677923875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_IhjVLbgZUmM/SpasL5rYhvI/AAAAAAAAABM/rxnwCbK3NA8/S220/n584352672_3079.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5205671691245928993.post-5902272913583628257</id><published>2009-07-12T08:56:00.001-07:00</published><updated>2009-07-12T12:06:09.108-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='api-design'/><category scheme='http://www.blogger.com/atom/ns#' term='autobox'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><category scheme='http://www.blogger.com/atom/ns#' term='perl5i'/><category scheme='http://www.blogger.com/atom/ns#' term='oop'/><title type='text'>Why I don't like Autobox</title><content type='html'>So I was looking over Michael Schwern's &lt;a href="http://search.cpan.org/dist/perl5i/"&gt;perl5i&lt;/a&gt; module recently (after &lt;a href="http://yapc10.org/yn2009/talk/2155"&gt;hearing about it at this years YAPC::NA&lt;/a&gt;) and I noticed that it enables the &lt;a href="http://search.cpan.org/dist/autobox/"&gt;autobox&lt;/a&gt; module. This reminded me of all the debates I have had with Matt Trout over the years about the various pros and cons of &lt;a href="http://search.cpan.org/dist/autobox/"&gt;autobox&lt;/a&gt;. So I figured this would probably make a decent blog post, so here goes.&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;div&gt;My core objection to &lt;a href="http://search.cpan.org/dist/autobox/"&gt;autobox&lt;/a&gt; is that it is an illusion. It works by hijacking the normal perl method resolution process and right before perl says "Cannot call method 'foo' on unblessed reference" it checks specific packages to see if there are available methods. This gives the illusion that these core perl types are in fact objects, when in reality they are very much not. If they were proper objects, they would &lt;span class="Apple-style-span" style="font-style: italic;"&gt;always&lt;/span&gt; be objects instead of just objects within the lexical scope of the autobox pragma. Here is some code that illustrates what (for me) is the big abstraction leak of autobox.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;my $test;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    use autobox;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    my $foo = [ 1, 2, 3, 4, 5 ];&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    warn $foo-&gt;length;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    $test = sub {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        warn $foo-&gt;length; # succeeds ...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        $foo;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    };&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;my $x = $test-&gt;();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;warn $x-&gt;length; # fails&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This example shows how the lexical scoping of the autobox pragma allows the &lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;$test&lt;/span&gt; closure to still work correctly, but once outside of the lexical scope the value is no longer autoboxed. This just seems really backwards to me because it requires the users of your code to also enable autobox in &lt;span class="Apple-style-span" style="font-style: italic;"&gt;their&lt;/span&gt; code to use elements from &lt;span class="Apple-style-span" style="font-style: italic;"&gt;your&lt;/span&gt; code. The result of them (for whatever reason) &lt;span class="Apple-style-span" style="font-style: italic;"&gt;not&lt;/span&gt; doing this is that your internal usage of a data element can greatly differ from external usage of the same element. This is an API disconnect that does not sit well with me.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In short, autoboxing is a feature of the lexical environment and not something intrinsic to the element itself. &lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;My second issue with autobox is that it is very shallow. In languages where the core types are proper objects (Smalltalk, Ruby, Javascript, etc.) it is possible to subclass/extend these core types using normal OO practices. Autobox provides the illusion of normal OO, but as soon as you look any deeper the the surface the illusion starts to crumble at an alarming rate. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;While it is possible to do something close to subclassing/extending with autobox code by using the following technique, it has some severe drawbacks and serious inconsistencies. &lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    package ARRAY;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    sub length { scalar @{ $_[0] } }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    package MyArray;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    use base 'ARRAY';&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    # do something silly here for illustration&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    sub length { (shift)-&gt;SUPER::length + 1 }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    use autobox;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    my $foo = [ 1, 2, 3, 4, 5 ];&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    warn $foo-&gt;length; # 5&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    my $bar = bless [ 1, 2, 3, 4, 5 ] =&gt; 'MyArray';&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    warn $bar-&gt;length; # 6&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The most obvious issue is that this only works for reference types (ARRAY, HASH and CODE) since Perl only allows blessing of references. So you cannot use this with SCALAR, INTEGER, FLOAT, NUMBER, STRING and UNDEF which leaves out more then half of the functionality of autobox.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Also, the manual blessing of the subclassed array ref seems a little odd since it differs from how the regular autoboxed array ref works. Of course you could create a MyArray::new method to hide this if you want. If you did this then perhaps for consistencies sake you would want to ARRAY::new as well. But unless you blessed the array ref into the ARRAY package then a user of your code would need to have autoboxing enabled for &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;ARRAY-&gt;new&lt;/span&gt; to return anything useful, because (as I said above) the autoboxing is not intrinsic functionality, but instead functionality of a given lexical environment. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now, my last issue with autobox is that if used with the wrong kind of laziness is can expose the internals of an object and defeat encapsulation and make bad APIs. This was the original motivation behind my writing &lt;a href="http://search.cpan.org/dist/MooseX-AttributeHelpers/"&gt;MooseX::AttributeHelpers&lt;/a&gt; after having written &lt;a href="http://search.cpan.org/dist/Moose-Autobox/"&gt;Moose::Autobox&lt;/a&gt;.  Take this example for instance.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    package MyThings;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    use Moose;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    use Moose::Autobox;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    has 'things' =&gt; (&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        is      =&gt; 'ro',&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        isa     =&gt; 'ArrayRef',   &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        default =&gt; sub { [] },&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    );&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    my $me = MyThings-&gt;new;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    $me-&gt;things-&gt;push( 1 );&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It is very tempting to just let the autoboxing provide the API to add things to your object, but this exposes a lot of internal details to your objects consumer. If at some point you want to change how &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;things&lt;/span&gt; are stored you will have a lot of work  to do. Of course this is better then if users had been doing &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;push(@{ $me-&gt;things }, 1)&lt;/span&gt; because you still have the encapsulation of the autoboxed APIs. But having to write an interface to match ARRAY for whatever you change &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;things&lt;/span&gt; to use is just going to get nasty after a while.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Perceptive readers will also note that &lt;span class="Apple-style-span" style="font-family: 'courier new'; "&gt;$me-&gt;things-&gt;push( 1 )&lt;span class="Apple-style-span" style="font-family: Georgia; "&gt; will not work  unless autoboxing is enabled in that particular lexical environment. Again placing a lot of responsibility on the users of your code just to use the API your providing.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In contrast the &lt;a href="http://search.cpan.org/dist/MooseX-AttributeHelpers/"&gt;MooseX::AttributeHelpers&lt;/a&gt; (soon to be core Moose) version is much more encapsulation friendly and is much more amenable to future changes to the storage type of &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;things&lt;/span&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    package MyThings;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    use Moose;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    use MooseX::AttributeHelpers;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    has 'things' =&gt; (&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        traits   =&gt; [ 'Collection::Array' ],&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        is       =&gt; 'ro',&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        isa      =&gt; 'ArrayRef',   &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        default  =&gt; sub { [] },&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        provides =&gt; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;            push =&gt; 'add_thing'&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    );&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    my $me = MyThings-&gt;new;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    $me-&gt;add_thing( 1 );&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;If you change how &lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;things&lt;/span&gt; are stored, you simply need to re-write the &lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;add_things&lt;/span&gt; method. Everything is properly encapsulated within your object as it should be. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So anyway, thats enough of my autobox ranting. I think that autobox is an extremely interesting piece of software and by no means do I think people should not use it if they are so inclined to. But I think it should be used carefully and with full knowledge of it's limitations and issues. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5205671691245928993-5902272913583628257?l=stevan-little.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stevan-little.blogspot.com/feeds/5902272913583628257/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stevan-little.blogspot.com/2009/07/why-i-dont-like-autobox.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/5902272913583628257'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/5902272913583628257'/><link rel='alternate' type='text/html' href='http://stevan-little.blogspot.com/2009/07/why-i-dont-like-autobox.html' title='Why I don&apos;t like Autobox'/><author><name>Stevan Little</name><uri>http://www.blogger.com/profile/01804375611677923875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_IhjVLbgZUmM/SpasL5rYhvI/AAAAAAAAABM/rxnwCbK3NA8/S220/n584352672_3079.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5205671691245928993.post-6681284123893351745</id><published>2009-06-13T12:10:00.000-07:00</published><updated>2009-06-13T12:11:27.248-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='moose'/><category scheme='http://www.blogger.com/atom/ns#' term='mop'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Why make_immutable is recommended for Moose classes</title><content type='html'>&lt;a href="http://www.perlmonks.org/index.pl?node_id=771222"&gt;Someone on perlmonks&lt;/a&gt; asked&lt;div&gt;&lt;blockquote&gt;Can you point me to a good explanation of why make_immutable is recommended?&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;And I realized in the documentation we really only say (in&lt;span class="Apple-style-span"  style="color: rgb(0, 102, 153); font-family:arial;"&gt; &lt;span class="Apple-style-span"  style="color: rgb(0, 0, 0);  font-family:Georgia;"&gt;&lt;a href="http://search.cpan.org/~drolsky/Moose-0.81/lib/Moose/Manual/BestPractices.pod"&gt;Moose::Manual::BestPractices&lt;/a&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;making classes immutable speeds up a lot of things, most notably object construction.&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;So instead of burying my explanation deep inside Perlmonks I thought I would explain it here (and add to my &lt;a href="http://ironman.enlightenedperl.org/"&gt;Iron Man&lt;/a&gt; creds).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So, Moose metaclasses are built specifically so that they can be altered at any time from anywhere and still remain a valid and correct class. This is why there is no &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;__PACKAGE__-&gt;finalize_class&lt;/span&gt; or similar type of method call required at the end of your Moose class definition. But doing things this way does come at a price in that some of the meta-level calls can be very expensive. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For instance, if you wanted to know all the attributes supported by a class, you would need to collect all the local attributes, then visit each superclass (recursively) and collect all those attributes while being sure to skip all overridden attributes. This can get quite expensive and since we allow for you to, at any time, alter the inheritance structure or add/delete attributes via the MOP, this means we can not cache the results of that query (well we could cache it, but then we would have to have all sorts of extra code to check the cache and invalidate it, etc. etc.). &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So what you are doing when you make a Moose class immutable, is actually saying "it is okay to cache things, I am not going to mess with the metaclass".  At that point Moose takes the opportunity to memoize many of the MOP calls and install methods that throw exceptions when you try and alter the metaclass, effectively making the class read-only. However, this really only helps speed up calls to &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;-&gt;meta&lt;/span&gt; methods, so we also then take it one step further. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The example I gave above, of checking all attributes in a class, may seem kind of esoteric and not something one usually needs to care about, but this is &lt;span class="Apple-style-span" style="font-style: italic;"&gt;exactly&lt;/span&gt; what Moose needs to do every time it creates an instance of an object. It needs to do this in order to properly initialize all the slots in an instance, fire any triggers, check any type constraints, perform any type coercions and call all &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;BUILD&lt;/span&gt; methods in the inheritance graph in the correct order. By memoizing the computed list of all inherited attributes we are actually saving quite a lot of computation, but honestly that is not enough. So we actually take the opportunity to inline and compile our own optimized constructor method that does the &lt;span class="Apple-style-span" style="font-style: italic;"&gt;exact same thing&lt;/span&gt;, but in much less time. The result is that object construction is significantly faster during the runtime of the program (which is when it really counts) and we instead  take the compile-time hit of the code construction and evaluation. And since we are in there already we also inline a &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;DESTROY&lt;/span&gt; method which correctly calls all the &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;DEMOLISH&lt;/span&gt; methods in the correct order (Moose already, by default, will inline your attribute accessors, but if it didn't then it would do that as well).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So the short answer is that making your class immutable is good because it memoizes several metaclass methods and installs an optimized constructor and destructor for your class and therefore helps reduce a fair amount of the cost (during runtime) of all the abstraction that the MOP provides.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5205671691245928993-6681284123893351745?l=stevan-little.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stevan-little.blogspot.com/feeds/6681284123893351745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stevan-little.blogspot.com/2009/06/why-makeimmutable-is-recommended-for_13.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/6681284123893351745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/6681284123893351745'/><link rel='alternate' type='text/html' href='http://stevan-little.blogspot.com/2009/06/why-makeimmutable-is-recommended-for_13.html' title='Why make_immutable is recommended for Moose classes'/><author><name>Stevan Little</name><uri>http://www.blogger.com/profile/01804375611677923875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_IhjVLbgZUmM/SpasL5rYhvI/AAAAAAAAABM/rxnwCbK3NA8/S220/n584352672_3079.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5205671691245928993.post-5235248722568501010</id><published>2009-06-08T22:14:00.000-07:00</published><updated>2009-06-10T21:08:48.364-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='moose'/><category scheme='http://www.blogger.com/atom/ns#' term='yapc'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>YAPC::NA Moose Hackathon</title><content type='html'>We are planning a &lt;a href="http://yapc10.org/yn2009/wiki?node=Hackathon"&gt;Moose hackathon&lt;/a&gt; after YAPC::NA this year. It should be a nice compliment to &lt;a href="http://yapc10.org/yn2009/talk/2047"&gt;Dave Rolsky's Moose course&lt;/a&gt; as well as the &lt;a href="http://yapc10.org/yn2009/talks/tag/moose"&gt;several Moose related talks&lt;/a&gt; on the schedule, so if you can stay an extra day or two in Pittsburgh come and hang out and talk/hack some Moose.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5205671691245928993-5235248722568501010?l=stevan-little.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stevan-little.blogspot.com/feeds/5235248722568501010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stevan-little.blogspot.com/2009/06/yapcna-moose-hackathon.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/5235248722568501010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/5235248722568501010'/><link rel='alternate' type='text/html' href='http://stevan-little.blogspot.com/2009/06/yapcna-moose-hackathon.html' title='YAPC::NA Moose Hackathon'/><author><name>Stevan Little</name><uri>http://www.blogger.com/profile/01804375611677923875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_IhjVLbgZUmM/SpasL5rYhvI/AAAAAAAAABM/rxnwCbK3NA8/S220/n584352672_3079.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5205671691245928993.post-8095534813686302734</id><published>2009-06-06T10:48:00.000-07:00</published><updated>2009-06-06T10:58:29.550-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='moose'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Moose Bus Factor</title><content type='html'>&lt;div&gt;One of the most common problems in many software projects is the &lt;a href="http://en.wikipedia.org/wiki/Bus_factor"&gt;Bus Factor&lt;/a&gt;. This can be especially true of Open Source projects even if they have a lot of contributors, because it is not often that a project will get another developer who is as steeped in the code as the original author.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I am happy to say that the Bus Factor for Moose is now a solid 2 and able to expand easily up to 5 and Class::MOP is the same if not better. This is not to count out the other 50+ contributors at all. Several of them have been steadily climbing in these lists over the past few months.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here is the output of git-blame for Moose.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Total lines: 45996&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;       18954  41.21%  Stevan Little&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;       15270  33.20%  Dave Rolsky&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        3556   7.73%  Yuval Kogman&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        2414   5.25%  Shawn M Moore&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        1038   2.26%  Chris Prather&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;         414   0.90%  John Napiorkowski&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;         387   0.84%  Tomas Doran&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;         333   0.72%  Guillermo Roditi&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;         298   0.65%  Jesse Luehrs&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;         274   0.60%  Todd Hepler&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;         259   0.56%  Lars Dieckow&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;         259   0.56%  Hans Dieter Pearcey&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;         195   0.42%  Anders Nor Berle&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;         187   0.41%  Matt S Trout&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;         186   0.40%  Nathan Gray&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;         186   0.40%  Aankhen&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;         182   0.40%  Jonathan Rockway&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;         177   0.38%  Jesse Vincent&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;         172   0.37%  Aran Clary Deltac&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;         150   0.33%  *initial checkin&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;         110   0.24%  John Goulah&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;         103   0.22%  Tomas Doran (t0m)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          89   0.19%  Dann&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          88   0.19%  Marcel Grunauer&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          88   0.19%  Ricardo SIGNES&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          73   0.16%  Jess Robinson&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          63   0.14%  Evan Carroll&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          56   0.12%  Justin DeVuyst&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          55   0.12%  Ash Berlin&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          50   0.11%  Daisuke Maki (lestrrat)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          46   0.10%  Wallace Reis&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          41   0.09%  Florian Ragwitz&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          40   0.09%  Tokuhiro Matsuno&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          33   0.07%  Adam J. Foxson&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          32   0.07%  Marc Mims&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          23   0.05%  Robert 'phaylon' Sedlacek&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          18   0.04%  Cory G Watson&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          18   0.04%  Scott McWhirter&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          15   0.03%  Paul Jamieson Fenwick&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          13   0.03%  michaelr&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          11   0.02%  Tomas Doran (t0m&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;           7   0.02%  Adam Kennedy&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;           5   0.01%  Robert Boone&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;           5   0.01%  Nelo Onyiah&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;           4   0.01%  t0m&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;           4   0.01%  Mike Whitaker&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;           2   0.00%  Piotr Roszatycki&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;           2   0.00%  Eric Wilhelm&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;           2   0.00%  Paul Driver&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;           2   0.00%  Christian Hansen&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;           2   0.00%  hakim&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;           1   0.00%  Marcus Ramberg&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;           1   0.00%  John Douglas Porter&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;           1   0.00%  Jay Hannah&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;           1   0.00%  Shlomi Fish&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;           1   0.00%  Cory Watson&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And here are the same for Class::MOP.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Total lines: 26107&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;       11109  42.55%  Stevan Little&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        5107  19.56%  Dave Rolsky&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        4525  17.33%  Chris Prather&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        1919   7.35%  Yuval Kogman&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        1606   6.15%  Florian Ragwitz&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;         702   2.69%  Guillermo Roditi&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;         647   2.48%  Shawn M Moore&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          98   0.38%  nperez&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          89   0.34%  Matt S Trout&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          70   0.27%  Ricardo SIGNES&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          50   0.19%  *initial checkin&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          42   0.16%  Tomas Doran&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          36   0.14%  Todd Hepler&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          29   0.11%  Hans Dieter Pearcey&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          26   0.10%  Jesse Luehrs&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          24   0.09%  Marc Mims&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;          11   0.04%  Brandon L Black&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;           5   0.02%  Robert Boone&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;           4   0.02%  Scott McWhirter&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;           3   0.01%  Jonathan Rockway&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;           2   0.01%  Flavio Poletti&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;           2   0.01%  Shlomi Fish&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;           1   0.00%  Rob Kinyon&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I am quite happy with this, as it now means that I can cross the street without fear.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5205671691245928993-8095534813686302734?l=stevan-little.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stevan-little.blogspot.com/feeds/8095534813686302734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stevan-little.blogspot.com/2009/06/one-of-most-common-problems-in-many.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/8095534813686302734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/8095534813686302734'/><link rel='alternate' type='text/html' href='http://stevan-little.blogspot.com/2009/06/one-of-most-common-problems-in-many.html' title='Moose Bus Factor'/><author><name>Stevan Little</name><uri>http://www.blogger.com/profile/01804375611677923875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_IhjVLbgZUmM/SpasL5rYhvI/AAAAAAAAABM/rxnwCbK3NA8/S220/n584352672_3079.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5205671691245928993.post-4210028169741710967</id><published>2009-06-03T17:14:00.000-07:00</published><updated>2009-06-03T22:11:35.151-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='moose'/><category scheme='http://www.blogger.com/atom/ns#' term='api-design'/><category scheme='http://www.blogger.com/atom/ns#' term='dwimery'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Moose and DWIMery</title><content type='html'>So Ovid recently &lt;a href="http://use.perl.org/~Ovid/journal/39070"&gt;discovered that Moose does not create any accessors by default&lt;/a&gt;. Which was surprising to him and truthfully has surprised many people over the years. We on #moose have discussed this many times and the general consensus has always been to leave it as it is. I explain in the comments to Ovid's post why this is so, but I figured that for my inaugural blog post I should expand on this topic.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;DWIMery and the Slippery Slope&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;DWIMery ("Do What I Mean"-ery) can be a very valuable thing when designing APIs but it does come at a cost. The more specific your API, the easier it is to DWIM since the option set is likely pretty small and defaults are usually obvious. But the more general your API, the harder it is to strike a balance. The problem gets even more so when you are designing something like an object system or a language. A system like Moose needs to not only support doing what &lt;span class="Apple-style-span" style="font-style: italic;"&gt;I&lt;/span&gt; mean, but also doing what &lt;span class="Apple-style-span" style="font-style: italic;"&gt;everyone else&lt;/span&gt; means as well. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Opinionated Software vs. TimToady&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Recently there has been a trend towards more "opinionated" software (Ruby On Rails) and even "opinionated" languages (Python).  The popularity of both these pieces of software shows that many people like this trend. However, Moose is Perl, and in Perl we subscribe to TIMTOWDI (There Is More Than One Way To Do It). On some level, you could say that opinionated software is actually the antithesis of TIMTOWTDI.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now this is not to say that Moose is not opinionated or is somehow the pinnacle of  TIMTOWTDI. In fact Moose is actually pretty opinionated and I strongly believe that too much TIMTOWTDI is one of the reasons that Perl has the negative reputation it has for maintainability and code clarity. But what Moose does differently is to be humble about its opinions and make it easy (for some value of "easy") to override those opinions and inject your own.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://chris.prather.org/perl/"&gt;Chris Prather&lt;/a&gt; actually suggested just such a solution in one of his comments to Ovid's post. The syntax looks something like this:&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" ;font-family:-webkit-serif;"&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;package Foo;&lt;br /&gt;use Moose -traits =&gt; ['ReadOnly'];&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;has 'bar';&lt;br /&gt;has 'baz';&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;This could be accomplished by making a "trait" (the Moose term for a role that is applied to a meta-level object) which would affect the metaclass such that any time an attribute was created it would force a default read-only accessor to be created. While this sounds complicated it would actually be fairly simple, the trickiest part being dealing with merging your default read-only-ness with any user specified options.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Why Moose doesn't create accessors by default&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Moose has always aimed to be as Perl-ish as possible, which means trying to embody the spirit of TIMTOWTDI. As I mentioned in one of my responses to Ovids post, the choice of &lt;span class="Apple-style-span" style="font-style: italic;"&gt;which&lt;/span&gt; type of accessors Moose should create is not so simple. My personal inclination is towards generating simple read-only accessors, others might expect read/write accessors to be the default (which is what other common Perl OO modules like Class::Accessor provide). But this ignores the suggestions that Damian made in Perl Best Practices or the people who like semi-affordance accessors (-&gt;foo for reading and -&gt;set_foo for writing) or the people who prefer public readers/private writers. The list can go on and on, and each and every one of these is an equally valid choice. &lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In my mind the only solution when faced with all these differing and equally valid viewpoints is to actually favor &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;none&lt;/span&gt; of them, but allow &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;all&lt;/span&gt; of them. And of course, this is exactly what Moose does. I believe that this is most in keeping with the spirit of TIMTOWTDI and therefore the most Perl-ish. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5205671691245928993-4210028169741710967?l=stevan-little.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stevan-little.blogspot.com/feeds/4210028169741710967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stevan-little.blogspot.com/2009/06/moose-and-dwimery.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/4210028169741710967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5205671691245928993/posts/default/4210028169741710967'/><link rel='alternate' type='text/html' href='http://stevan-little.blogspot.com/2009/06/moose-and-dwimery.html' title='Moose and DWIMery'/><author><name>Stevan Little</name><uri>http://www.blogger.com/profile/01804375611677923875</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://4.bp.blogspot.com/_IhjVLbgZUmM/SpasL5rYhvI/AAAAAAAAABM/rxnwCbK3NA8/S220/n584352672_3079.jpg'/></author><thr:total>0</thr:total></entry></feed>
