Hi,
Sartak a écrit :
Hi Alexis,
I've been aware of Coat since you started it. (But I hadn't seen the
value of a lite Moose until much later). I had even contributed two
patches. :)
Indeed, and I thank you for that ;)
I started Mouse (originally called Neutrino) a few months ago for fun,
to better understand how Moose fits together. It wasn't going to be
anything serious or used by anything. But then I mentioned it to a few
people and here we are.
Ok,
Mouse strives very hard to be a *compatible*, fast, light replacement
for Moose. Coat is the latter two. It's marginally compatible, but
running s/Coat/Moose/g will probably not work for a decent sized
project.
Maybe, but I think I should precise my baseline when I'm at working on
Coat:
Coat should be as compatible as possible to Moose when it's not about
meta. To be short: there's no point to rewrite Class::MOP, I don't think
a tiny-fast-perl5-core-only code will be able to do what Class::MOP does.
After talking with Stevan on IRC a couple of months ago, we agreed on
that: if you need strong meta information, go use Moose; otherwise, it's
a descent target for Coat to be a light-remplacement.
Yes, I know, it's not already the case, and some parts are just not even
started (like Roles) but this is a target for me. That's why I'm taking
as many tests I can from Moose's test-suite and add them to Coat. I want
Coat features to be as compatible as possible to Moose.
So, again, I fear we're starting to do duplicate work here, I would be
so glad to welcome you to the Coat maintenance, if you'd like to ;)
There are too many details that are different. For example,
if you leave out the "is" option to "has" in Coat, you get a
read-write accessor. In Moose, you get no accessor (not even
read-only). Coat probably did this to optimize for convenience. But it
is something you have to know about when upgrading from Coat to Moose.
Well, as I said above : this is a bug in Coat. Every Moose's feature
implemented in Coat should behave like in Moose, as long as it doesn't
involve meta-data exposition.
I'm going to fix that soon, hopefully I can find a test that put that
issue into the light).
I've tried to model even Mouse's internals on Moose as well. I have
Mouse::Meta::Attribute, Mouse::Meta::Class->linearized_isa, etc. Mouse
does provide a very barebones MOP, but that's often all you need.
Almost all of the features provided by Mouse's MOP are given the same
name and functionality as Moose. Even if you use the MOP you can
probably safely upgrade from Mouse to Moose. Coat's MOP is quite a bit
different (not bad, just different).
Then we have a divergence of concept there. Indeed Coat's MOP is
different from Moose's, for the reasons I explained before.
There are a number of Moose features (such as practically all the type
features) that Coat has that Moose doesn't have yet. Coat::Persistent
is also nowhere to be seen in Mouse. So I think there's plenty of room
in this space for two (or five) lightweight Mooses. :)
I don't think Coat::Persistent as something to do with this debate ;)
It's just an ORM that is using Coat.
Anyways, as the Perl mantra said: "there's more than one way to do
it"[1], so I understand your path, but don't forget you're more than
welcome if you like to contribute to Coat (event tests that shows up bug
of Moose's compatibility).
Regards,
Alexis
1: by the way I had to fight a little when I starting working on Coat,
some people were angry because of the idea behind Coat; I'm happy to see
that, at the end, I was right: there's is room and even need for
light-weight Mooses.