6 ms·
Introduction to Moose, Perl’s OO system
- lelf 12y agoNotice that they are all just libraries, dedicated changes in Perl’s core: 0.
- swuecho 12y agoYou are right, but it is on its way to Perl Core. https://github.com/stevan/p5-mop-redux https://github.com/stevan/p5-mop-redux
- esaym 12y agoand as they say "standard lib is where modules go to die"
- peteretep 12y agoI see that as a feature, honestly; what other languages have an OO system so massively flexible that you can easily build stuff like this on top of it? Perl's OO system is often derided as "bolted-on", but once you thoroughly understand `bless` and `->`, your imagination is the limit.
- ghkbrew 12y ago> what other languages have an OO system so massively flexible that you can easily build stuff like this on top of it? Lisp ...sorry I couldn't help myself
- kevin_thibedeau 12y agoTcl and Python also have (multiple) bolted on OO systems that can be altered at will.
- lispm 12y agoSee the Common Lisp Object System (CLOS) and its Meta-Object Protocol (MOP).
- kbenson 12y agoMoose is back-ported Perl6 objects, which borrows heavily from CLOS and the concepts introduced in the Smalltalk traits paper. This is a bit of a simplification of the history, but the ancestry is present, documented and obvious.
- victormx 12y ago¿it's hard to put a next/previous button?
- esaym 12y agobottom right if you have js enabled...
- ben0x539 12y agoIf you have js disabled, you get the whole thing as a normal document with a scrollbar.
- Todd 12y agoYeah, don't accidentally hit the back button to go to the previous page. There's no history, so you'll end up here and you'll have to start over.
- mkadlec 12y agoWhy not just use Ruby, all of this is already built in?
- csirac2 12y agoReally? Because although I came from Ruby (and before that, C, ASM), I spent 4 years in Perl with half of that doing Moose stuff. Now I'm doing Python, C, and hardware stuff. I really miss Moose. Pythonistas generally can't believe I could possibly miss anything from the Perl world, and usually aren't interested in hearing my reasons why. But honestly - I miss doing 75% of my work in bashing out an declarative specification with Moose, especially with the type system (as slow as that can be at runtime; the work-around is making objects immutable which leads to cleaner code anyway). Python does have the traits package by enthought, which has some vaguely similar stuff in it but nobody seems to use it. Being out of the ruby loop for a while, what's ruby's answer to Moose?
- welder 12y agoAn alternate perspective: I've used Perl for 10+ years, but switched to Python 5 years ago. Moose was a hack to bring Java patterns to Perl, but I feel Java patterns are not developer friendly these days. Python patterns are still solid today, so I gladly choose doing things the Pythonic way over the Perl way. Not to mention the meta reasons to use a language (community, libraries, ecosystem).
- autarch 12y ago> Moose was a hack to bring Java patterns to Perl Say what now? Moose draws from most heavily from CLOS and Smalltalk, as filtered through Perl 6. I don't know of any Java influence in Moose at all.
- perigrin 12y agoThere was a little. Mostly stevan and Yuval going "oh god not that".
- 12y ago
- swuecho 12y agoThe talk is great. For those who do not have the patience, this is the doc of Moose https://metacpan.org/pod/Moose https://metacpan.org/pod/Moose This is the Moose Cookbook https://metacpan.org/pod/Moose::Cookbook https://metacpan.org/pod/Moose::Cookbook I think this is pretty much everything you need to start using Moose.
- MichaelBurge 12y agoMoose is a killer library for Perl. I really miss roles when working in other languages. I often feel like I'm fighting the language if I can't split out some common program logic into a separate module and compose it in. I can get by in C++(using multiple inheritance and the CRTP), and Haskell(with typeclasses). D has some interesting features - like template mixins - that look promising, but I haven't been gutsy enough to use it for any new project.
- csirac2 12y agoI'm glad I'm not the only one! Explaining why I'd possibly miss anything from the Perl world can sometimes be like pulling teeth.
- TheDauthi 12y agoI'm a heavy Rubyist these days, and Moose is one of the very few things I miss from the realm of Perl. Here's a fun game: the next time someone asks you what technologies you work with or languages you prefer, somehow work in that you like Perl, at least Modern Perl with Moose. Count which one occurs most frequently: people backing away like you've begun frothing at the mouth, people asking if you've ever heard of ANOTHER_TECHNOLOGY (usually Ruby, sometimes Python), and people who assume you're a sysadmin who occasionally scripts something (they'll ask if you've ever used Puppet or Chef).
- NAFV_P 12y ago> Count which one occurs most frequently: people backing away like you've begun frothing at the mouth, people asking if you've ever heard of ANOTHER_TECHNOLOGY (usually Ruby, sometimes Python), and people who assume you're a sysadmin who occasionally scripts something (they'll ask if you've ever used Puppet or Chef). If you were to 'speak' Perl verbatim, you probably would start frothing at the mouth (from exertion, not from a deadly disease).
- rurounijones 12y agohttps://github.com/peczenyj/MooseX https://github.com/peczenyj/MooseX may be of interest to you then, there was a reddit post about it a few days ago. To be honest, as a ruby person, I don't really see what benefits it brings to ruby but maybe I am just missing something.
- autarch 12y agoI should point out that these are slides from a full day class where people also do a lot of exercises. You can see the whole thing at https://github.com/moose/intro-to-moose https://github.com/moose/intro-to-moose
- lightblade 12y agoThe JavaScript library Joose was inspired by moose. http://joose.it http://joose.it
- tmaly 12y agoGreat presentation. I have not used Moose much, but I have started using a lighter weight version of it called Moo.
- hernan604 12y agohttps://github.com/hernan604/Tutorial-Joose-JS-PT https://github.com/hernan604/Tutorial-Joose-JS-PT Joose js tutorial in portuguese =) Its possible to have all the moose power in javascript