Status update on the p5 MOP project

As I was doing my daily check of blogs.perl.org, I noticed a recent post by Ovid in which he said ...

Of course, we also need the p5-mop, but that hasn't been touched in a while; I hope it's not dead.

... and that reminded me I really needed to write a blog post to update folks on the status of the p5-mop effort, so here goes.

On porting a Moose module

I have been meaning to write this post for a while, but between $work and getting sick I have not really had the brain capacity to do it. Being that I am still a little sick and $work is still busy, I am making no promises about the quality of this post.

In a previous blog post I mentioned that I was going to port my module Bread::Board to p5-mop which I managed to finish up about three weeks ago and then promised to write a post about my experience. Well better late then never, here is that post.

NOTE: if all the Bread::Board terminology gets tedious, skip down to the TL;DR at the end to read my conclusions.

p5-MOP speedups, new traits and more ports

I recently took a vacation with my family and actually didn't spend any time working on p5-mop-redux (or any code for that matter) which was actually kind of nice (odd but nice). But thankfully Jesse Luehrs, my co-conspirator on the previous p5-mop attempt, found himself with some free time and so was hacking away. He ported one of his newest modules, Reply (which is a really nice REPL for Perl, you should try it) and noticed that the startup time was pretty slow (something important for a REPL). Of course this is to be expected in a prototype, but still, Jesse went and added this simple method cache which resulted in an almost 3x speedup for startup time.

Jesse also added two new class traits both of which are important for enabling users to subclass MOP based classes using non-MOP based classes.

Mapping the MOP to Moose

I spent much of last week on vacation with the family so very little actual coding got done on the p5-mop, but instead I did a lot of thinking. My next major goal for the p5-mop is to port a module written in Moose, in particular, one that uses many different Moose features. The module I have chosen to port is Bread::Board and I chose it for two reasons; first, it was the first real module that I wrote using Moose and second, it makes heavy use of a lot of Moose's features. I actually expect this port to be much more involved and require more actual design changes then the other ports have, simply because not all the Moose features used will be easily translated into MOP idioms. So in preparation for this I have been doing a lot of thinking about mapping the MOP to Moose and even started writing some documentation for it.

More tests and more traits for p5-MOP

I have been spending a lot of time lately porting modules to p5-mop as a way to really stretch and test out the prototype. Additionally a few other people are also porting modules as well. The result is that we now have a nicely expanding "external" test suite. This is something I found with Moose, while it is very nice to have a good size test suite, it is even better to have real modules (that perform real work) and themselves have good test suites. For a module like Moose and a project like p5-mop, this kind of testing is critical in exposing issues that normal unit tests just won't shake out.

About Stevan Little

user-pic I am the original author of Moose and am (again) working on the p5-mop project to bring some of the core features of Moose into the core. I am also conducting a thought experiment called Moe to see what an Ultra Modern Perl 5 would look like.