Planet Moose – October 2013

This is a very old article. It has been imported from older blogging software, and the formatting, images, etc may have been lost. Some links may be broken. Some of the information may no longer be correct. Opinions expressed in this article may no longer be held.

Welcome to Planet Moose, a brief write up on what’s been happening in the world of Moose in the past month, for the benefit of those of you who don’t have their eyes permanently glued to the IRC channel, or the MetaCPAN recent uploads page.

Thanks for contributions from Damien Krotkine; and thanks to Upasana Shukla for allowing me to interview her. If you’d like to contribute some news for next month’s issue, you can do so on the wiki.

Moose

The big news is that Moose now throws blessed exception objects. The 2.1102 trial version is the first release with this feature. (I think MooseX::Exception::Rot13 is the first distribution to include a dependency on Moose::Exception.)

This means that catching Moose errors (with Try::Tiny for example) and dealing with them no longer requires parsing the error with regexps to figure out what error you’ve gotten. Instead you can simply check the exception’s isa method. Once the bulk of Moose-dependent modules are doing that, then the Moose developers will have more freedom to change and improve the error messages emitted by Moose with less fear of breaking people’s code that is relying on certain phrases appearing in regexps.

Interview with Upasana Shukla

Upasana Shukla who implemented the Moose exception objects as part of her OPW internship kindly agreed to answer a few of my questions. (What follows is edited slightly for brevity. The original unedited transcript is on the wiki.)

Out of all the OPW projects, what attracted you to the Perl one?

It’s a long story :D.

I started learning Perl in January, 2012 and using it since then for solving Project Euler problems and other programming related tasks.

When I got to know about OPW, without giving even a single thought, I decided to contribute to MetaCPAN, forked & cloned its git repository. I told about this to my brother, he suggested me not to do it because MetaCPAN is a heavy project & it won’t work well on my laptop. So, I dropped my plan of contributing to MetaCPAN.

Dancer was the other OPW project, but I didn’t think of doing it. I checked out some other projects also, most of them were Perl projects (but not sponsored by The Perl Foundation).

I decided to contribute to Twisted (an event-driven network engine written in Python) & dropped all of my plans to contribute to any Perl project. After application submission (on 3rd May), Marina Zhurakhinskaya told me that Perl projects have got only one applicant 🙁 (sadly, it’s true :(). Due to my Perl background, she suggested me to try for a Perl project, if I’m interested, because Twisted got so many applicants.

I sent a mail to Sawyer (Dancer’s mentor), but he was unavailable due to weekend. I got to know about Dancer2, which pointed me to Alexis Sukrieh’s blog. There I saw that Dancer2 uses Modern Perl concepts. I heard about Modern Perl before, but never tried to explore it. Then, while trolling on the Perl foundation’s OPW page, I noticed that there is one more project named Moose (I overlooked it in the first time). I just read a bit about Moose and saw that it’s also about Modern Perl. Seeing this similarity between Dancer2 & Moose, I decided to learn Modern Perl. I conversed with Moose’ mentor (Shawn) and told him the whole story about how I came to know about Moose & I’ll contribute to Moose if & only if I’ll find it more interesting than Dancer.

I went through chapter 7 of the Modern Perl book on Shawn’s suggestion & found it quite interesting. Before that I only knew about horrible way of doing OOP in Perl & Moose made it so easy. By that time, Sawyer also replied to me, I told him that I came to know about Moose via Dancer2 and I’m thinking of contributing to Moose.

This is what Sawyer said (how kind & honest, he is!):

    <sawyer_> you can't lose with Shawn and Moose, i assure you :)
    <sawyer_> and Moose is basically used by a large portion of Modern Perl
    code, so you'll be making a substantial contribution to the community

Thanks to Sawyer! I decided to contribute to Moose.

What change would you make to Moose if backwards compatibility were not an issue.

I’d like to change some metaclass compatibility code (if I’d have given enough time & Jesse’s mentorship B-) ). There’re around 5-6 exceptions from that part which annoyed me most. For example, this exception, CannotFixMetaclassCompatibility is being thrown at four different places, Jesse showed me similar code in p5-mop, which handled it at one place & in a less complex way, so I’d like to see that thing in Moose also. That metaclass compatibility thing is a big scary monster :(.

Also, this exception : “Can only clone an instance” annoyed me, it’s related to bootstrapping process. I’d like to change it too (again time & mentor are the primary requirements :D). So that if in future, some other OPW/GSoC intern will work on Moose, he/she won’t need to fight with these monsters.

Now that your internship is over, do you plan on continuing to contribute to Moose and/or other Perl projects?

Yes, I’ll keep on contributing to Moose (though just taking a month’s break from contributing to Moose).

Yes, I’ve plan of contributing to other Perl projects. I’ve already started with Dancer, but I made a mistake. I started with a tough issue (related to session in Dancer2). Since, I’m quite new to Dancer, so it would have been better if I would have started with an easier issue.

Also, I talked to rjbs about working on some Dist::Zilla issues, so will definitely try them.

Other projects about which I checked in past few days are p5-mop (quite similar to Moose), Moe (didn’t understand anything) & some work related to packaging Perl modules in Ubuntu/Debian (I’m planning to learn packaging perl modules). Apart from Perl, I’d love to work on other languages also, primarily C.

p5-mop

Work has been pressing on to move as much of the syntax handling into XS to avoid issues with Parse::Keyword. In the course of these changes, all mop’s non-core dependencies have been eliminated with the exception of Devel::CallParser, which the mop developers hope might be added to the Perl core.

Yuki Kimoto proposed to seperate the method keyword implementation from the rest of the mop. There are already modules that provide this feature: Function::Parameters, Method::Signatures, and the new Kavorka. Stevan Little however shared his concerns about keeping method outside of the mop.

In other news…