Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The Moose library is a pretty advanced OO library that was inspired by Common Lisp's CLOS & Smalltalk I think. Most Perl developers I know use a large amount of libraries as the language itself is lacking in many areas. A lot of people are fine with that, but I prefer kitchen-sink languages which are fairly opinionated.


At least one of the inspirations of Moose, was the object system of Perl 6 at the time (now Raku https://raku.org using the #rakulang tag on social media). To create a Point class that has an x and a y attribute, you'd write:

    class Point {
        has $.x;
        has $.y;
    }
Object instantiation is then done with:

    Point.new(x => 42, y => 666);


Forgot about the inspiration from P6 (Raku). Thanks for mentioning Liz!


I'm sorry, Moose is a pig. Its startup time is atrocious. Its run time overhead is non-trivial. People who use Moose in my experience just showboat that they can do OO. Does it help? Maybe. But what it surely does is it makes a program run and startup significantly slower.


Things have moved on. Moose is a bit of kitchen sink. These days you would generally choose Moo first unless you really needed the meta object features. Or to get incremental Moo(se) features you’d use Role::Tiny, Class::Method::Modifiers And Type::Tiny




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: