Moose is turning 1yr old soon

Stevan on 2007-04-03T20:24:08

About a year ago I released the first version of Moose to CPAN, and since then we have used it extensively in a number of projects. And now with 3 apps which have been in production for between 6 and 9 months without issue, and positive reports from several other developers who have had similar experiences, I am happy to announce that Moose is pretty much ready for general use (i.e. - not scary anymore).

Huh, what,.. Moose??,.. what are you talking about??

For those who don't know, Moose is a complete modern object framework for Perl based on the work done by myself and others in the Pugs and Perl 6 projects. It does not claim to be Perl 6, but instead brings a Perl 6 like object system to Perl 5. This means it is built from the groud up to play nicely with existing Perl 5 objects and object systems.

So where can I get more information?

Well, lots of places actually. A good place to start is the Moose::Cookbook. Additional resources can be found from here as well.

There is also an ever growing set of MooseX:: plugins being developed to extend and enhance Moose (some are still under development here, but soon to be released).

I am also going to be giving a talk at the upcoming Perl NY Seminar on April 17th (I will post more details on this later), and (if they get accepted) hopefully at least one talk at this years YAPC::EU.

Does this mean 1.0 is coming out soon?

Nah, I decided 1.0 was just a number, and a silly one at that. The latest stable (0.18) should be thought of as "1.0" in spirit, just not in name.

-Stevan


Cool

sigzero on 2007-04-03T21:34:22

Do you know of any frameworks that are using Moose as a foundation?

Re:Cool

Stevan on 2007-04-03T22:02:24

Yes, the most public one is Reaction which is being built by the guys at Shadow Cat Systems (makers of DBIx::Class and other fine spirits). I have also received a number of emails from a few people who are building MVC style frameworks on top of Moose.

It should be noted that Moose plays fairly well with Catalyst (aside from one small issue with subroutine attributes and the 'extends' keyword which is easily worked around). And a number of people are already using that combination in production. At $work we have combined Moose with CGI::Application as well.

- Stevan

Link and doc issues

Alias on 2007-04-04T01:42:04

I've tried to use Moose three times now for Real Work (albeit small scale work) and failed. Not because the state of the code, but because of the state of the docs.

The main Moose page is very light on content, and the next step seems to be the cookbook pages, where I only have a choice of a range of levels of complexity in the demos.

I've found it really hard to find answers to specific single questions.

How do I do simple inheritance?

How do I do a single validating property?

Now frankly, I don't care about the answers to those specific things, but it's annoying when I can make a simple two-property class ( ->hello and ->world ) but making it incrementally more complex is hard, because the next level of demo class implements 50% of all the features in the toolkit and confuses things, and the third demo is already up into advanced material.

I'd like to see a series of simple examples. Hello World + Inheritance, Hello World + Validation, Hello World + etc...

Also, the Module::Cookbook link doesn't work.

Re:Link and doc issues

Stevan on 2007-04-04T02:13:22

Alias,

First, the cookbook link has now been fixed, thanks for spotting that.

Second, I freely admit that Moose might not be ergonimically correct for everyone. I based it heavily on Perl 6, but also added in my own twists and a few misc bits I have ripped off from other languages. But, this is Perl so TIMTOWTDI :)

As for your complaint about the docs. Well, I can't argue with you there, the docs are not as comprehensive as they could be (although I think they might have gotten better since you last looked). The upcoming talk I am giving should address that missing area you speak of, and i will gladly post the slides once it is ready. In the meantime I would be happy to answer any and all questions you might have, either on the #moose channel, the mailing list, or you can always feel free to email me directly.

- Stevan

No $self

jplindstrom on 2007-04-04T16:10:26

I have used it on toy projects and I like it, don't really have any issues.

But a really nice feature for me would be something (attribute, Moose declaration, source filter (I don't even care)) to say "this is a method" and automatically give me $self (or $class for a class method).

[hmmm... maybe I said this already]

I understand that's not the focus of Moose, but is something like that on the road map? Or is that an invitation for a MooseX something module? (MooseX::Selfless)

Re:No $self

Stevan on 2007-04-04T21:21:33

We had a method and self keyword in place for a while, it looked like so:

method foo => sub {
      self->bar
};
And self was implemented as a function which was redefiend locally. But to be honest, it added a fairly high amount of overhead to each method call (the wrapper subroutine and the local redefining of self), and it polluted the stack traces really badly with lots of ANONs. In the end I removed it cause it was just not the right way to go about it.

As for future plans to support that feature again, I don't have any specific ones, but I am open to suggestions if anyone has a better way to implement that without the overhead.

- Stevan