On Tue, Sep 9, 2008 at 4:20 AM, Michael G Schwern <[EMAIL PROTECTED]> wrote: > I looked at just copying in Mouse, but Mouse has dependencies which themselves > have dependencies, some of them with XS. Ideally, what I want is Mouse::Tiny, > or as I like to put it, "Muscle". [2] A stand-alone, single file, no non-core > dependencies, 5.6 compatible implementation of 80% of Moose. That way I can > just copy it into the Test::Builder2 distribution and have a real OO system.
I'd love to see Mouse itself go this way. There's little point in having a lightweight Moose that has a number of dependencies (especially XS). It looks like we could make all the dependencies optional, and only required if you use the features. Here are Mouse's direct dependencies, and why we have them: * Sub::Exporter is used for a more powerful export. I use its extra features (as a user of a Sub::Exporter module) very infrequently, so being able to drop down to regular Exporter would be useful. * Scalar::Util is used for blessed, weaken, looks_like_number, and openhandle. It's in core as of 5.8, but if we need 5.6 then I think we can make it work: - looks_like_number and openhandle are used only for the Num and FileHandle type constraints. These aren't used very often as far as I know, so perhaps we can delay-require Scalar::Util. - weaken is only used whenever you want weak refs for an attribute. I personally do this with some frequency. But if you don't use it - blessed is used a lot. "use Mouse" also exports it. We could probably provide an alternate implementation that uses ref and makes sure it isn't a builtin type. * MRO::Compat is used for get_linear_isa. We could implement this in Perl (and using mro::get_linear_isa if $] >= 5.10). * Class::Method::Modifiers are used for before/after/around. I wrote this one, so we have more flexibility here. It's only a few pages of code, so we could just add it into Mouse::OneFile, or again delay-load it. Anyway! I'd love to continue working on Mouse.