Show quoted text> Is this really that peculiar? What do other modules with Perl + XS implementations do in this regard? Do you have some other examples I could look at?
TIMTOWTDI, of course. :-)
Generally, what I see is a 'front-end' module that includes the PP
'backend' and that will transparently use the XS 'backend' if
installed. (As Math::Random::ISAAC does.)
The question is really what requires/recommends what? E.g.
* Class::Load::XS -- requires Class::Load; Class::Load recommends nothing
* Package::Stash::XS -- requires nothing (and recommends nothing), but
Package::Stash recommends Package::Stash::XS
In the Class::Load::XS case, it requires Class::Load because it
expects you to use that as the front-end. The back-end is useless
without it.
In the Package::Stash::XS case, it still expects you to use
Package::Stash as the front-end, but doesn't list it as a dependency.
(You're expected to do that yourself.) Instead, Package::Stash
recommends the XS version.
Why one approach vs the other?
To me, the advantage of the Class::Load::XS requiring the front-end is
that it avoids having to specify both as a prerequisite if you really
insist on needing the XS version.
On the other hand, if you're using recommends then it makes more sense
to have the front-end recommend a faster backend, but leave the
back-end requiring/recommending nothing (to avoid circular
dependencies).
[aside: there's been discussion of a need for a "soft recommends" that
wouldn't imply circularity, but no one has implemented that yet in the
toolchain.]
What Math::Random::ISAAC and ::XS appear to be doing is each
recommending the other, which is weird and circular.
On reflection, I would suggest adopting the Package::Stash/XS
approach. Your front-end should recommend the faster back end. Since
Math::Random::ISAAC::XS can work completely stand-alone, it doesn't
actually require Math::Random::ISAAC and should neither recommend it
or require it. (It should be listed in SEE ALSO, of course.)
So I'm changing my ticket request -- please just drop the recommends.
:-) I suspect my CPAN client was getting confused by the circularity
and I initially misunderstood what was going on.
Regards,
David
--
David Golden <dagolden@cpan.org>
Take back your inbox! →
http://www.bunchmail.com/
Twitter/IRC: @xdg