Moose

0 views
Skip to first unread message

Eric Wilhelm

unread,
Nov 25, 2009, 1:33:17 AM11/25/09
to WestsideProggers
Hi all,

If you like meta object hackery and large, antlered beasts, then boy
have I got a treat for you. I mentioned this at the meeting and was
surprised that nobody had heard of it.

"Moose is a postmodern object system for Perl 5..." is one way to
explain it. I call it "a MOP derived from the design of Perl 6". It
has its drawbacks in memory usage and startup time (though both have
improved) but many users are deploying it in production code.

http://www.iinteractive.com/moose/

--Eric
--
The reasonable man adapts himself to the world; the unreasonable man
persists in trying to adapt the world to himself. Therefore all progress
depends on the unreasonable man.
--George Bernard Shaw
---------------------------------------------------
http://scratchcomputing.com
---------------------------------------------------

M. Edward (Ed) Borasky

unread,
Nov 25, 2009, 1:52:11 AM11/25/09
to westside...@googlegroups.com
Funny you should mention Moose, what with Sarah Palin's book just
being released. ;-) I am actually running my CPAN install script even
as we speak, the culmination of which is installation of
Net:::Twitter, which requires Moose.

And yes, IIRC, there is a Squirrel too, but I haven't loaded it. ;-)
--
M. Edward (Ed) Borasky
http://borasky-research.net

"I've always regarded nature as the clothing of God." ~Alan Hovhaness

Matt Youell

unread,
Nov 25, 2009, 2:15:01 AM11/25/09
to WestsideProggers
On Nov 24, 10:33 pm, Eric Wilhelm <enoba...@gmail.com> wrote:
>
> If you like meta object hackery and large, antlered beasts, then boy
> have I got a treat for you.  I mentioned this at the meeting and was
> surprised that nobody had heard of it.

Well, there's "heard of it" and then there's "got what all the fuss
was about". :)

It's on my "to check out" list now. Unfortunately that list is quite
long.

M. Edward (Ed) Borasky

unread,
Nov 25, 2009, 2:26:32 AM11/25/09
to westside...@googlegroups.com
Any chance we can just stay with Perl 4? ;-)

Eric Wilhelm

unread,
Nov 25, 2009, 3:21:42 AM11/25/09
to westside...@googlegroups.com
# from M. Edward (Ed) Borasky
# on Tuesday 24 November 2009 23:26:

>Any chance we can just stay with Perl 4? ;-)

Feel free to install /usr/bin/perl4 and go nuts with it. Me, I'll be
bumping the minimum version of several of my CPAN modules to 5.10 and
using the //= operator, switch feature, plus perhaps the pluggable
regexp engine.

http://search.cpan.org/perldoc?Regexp::Grammars

Too much perl 4 code keeps masquerading as Perl code IMO.

<rant>Meanwhile, 5.10 has been in Debian stable for over a year now,
perl 5.12 is on its way, and people still seem to think that we CPAN
authors have some reason to be compatible with 5.6 or something.</rant>

--Eric
--
But as soon as you hear the Doppler shift dropping in pitch, you know
that they're probably going to miss your house, because if they were on
a collision course with your house, the pitch would stay the same until
impact. As I said, that one's subtle.
--Larry Wall
---------------------------------------------------
http://scratchcomputing.com
---------------------------------------------------

Jesse Hallett

unread,
Nov 25, 2009, 1:15:50 PM11/25/09
to westside...@googlegroups.com

There is also an implementation of Moose in JavaScript called Joose:

http://code.google.com/p/joose-js/

--~--~---------~--~----~------------~-------~--~----~ You received this message because you are sub...

Phil Tomson

unread,
Nov 25, 2009, 1:41:13 PM11/25/09
to westside...@googlegroups.com
On Tue, Nov 24, 2009 at 10:33 PM, Eric Wilhelm <enob...@gmail.com> wrote:
>
> Hi all,
>
> If you like meta object hackery and large, antlered beasts, then boy
> have I got a treat for you. I mentioned this at the meeting and was
> surprised that nobody had heard of it.

But after you said that it was slow and a memory hog I kind'a lost
interest... I think I'll wait for the Perl 6 implementation ;-)

Phil

Markus

unread,
Nov 25, 2009, 1:44:59 PM11/25/09
to westside...@googlegroups.com

> There is also an implementation of Moose in JavaScript called Joose:
>
> http://code.google.com/p/joose-js/

Thanks for the heads up Jessie. Do you know if they've apprehended the
perpetrators yet, or are they still at large?

-- Markus


Eric Wilhelm

unread,
Nov 25, 2009, 2:05:28 PM11/25/09
to westside...@googlegroups.com
# from Phil Tomson
# on Wednesday 25 November 2009 10:41:

>But after you said that it was slow and a memory hog I kind'a lost
>interest...  I think I'll wait for the Perl 6 implementation ;-)

I didn't say it is slow. I said it has a startup penalty (about 0.5s --
or 0.2s on a warm disk cache.) The bare memory overhead is about 18MB
(on top of perl's 11MB.)

Currently, a substantial class hierarchy like Chart::Clicker uses about
90MB total and takes 1.5s to load from a warm disk. This could
probably be improved by adding some lazy evaluation in strategic places
but most of the current Moose developers seem to be deploying in
persistent environments.

At runtime, it's as fast as any other perl OO depending on how much
validation code you're using. Slower than "blazing fast and loose"
hash key access, but probably still faster than ruby and definitely
faster than the current rakudo perl 6.

I hear there's a local project that allows you to benchmark analogous or
alternative solutions between multiple language interpreters
(http://github.com/notbenh/tool_bench -- angry pink unicorns
notwithstanding.)

--Eric
--
Human beings are relatively simple. You just reward them for something
and they will do it.
--William Cohan
---------------------------------------------------
http://scratchcomputing.com
---------------------------------------------------

M. Edward (Ed) Borasky

unread,
Nov 25, 2009, 6:47:51 PM11/25/09
to westside...@googlegroups.com
On Wed, Nov 25, 2009 at 11:05 AM, Eric Wilhelm <enob...@gmail.com> wrote:
> At runtime, it's as fast as any other perl OO depending on how much
> validation code you're using.  Slower than "blazing fast and loose"
> hash key access, but probably still faster than ruby and definitely
> faster than the current rakudo perl 6.

1. Faster than Ruby 1.9?
2. Ouch! Why is Rakudo Perl 6 so slow?

> I hear there's a local project that allows you to benchmark analogous or
> alternative solutions between multiple language interpreters
> (http://github.com/notbenh/tool_bench -- angry pink unicorns
> notwithstanding.)

These aren't the unicorns that fart glitter, are they?

Reply all
Reply to author
Forward
0 new messages