I'd recommend against doing this. If others are already (or eventually will) use the XS module but don't need the functionality from the one you propose to encompass it by, then they are two distinct distributions. One just so happens to use the other. What happens if you realize you want another small XS distribution... will you bundle that as well? Now people who want the first small library have to install a distribution with even more code they don't need.

I have several examples of this sort of thing. I put all of the dissimilar/separate XS code into their own distributions, then require it in higher-level distributions. That allows anyone to use X::Y; and use X::Z; without requiring them to use X; that may have brought in X::A through X::X, which contain functionality they have no need for.

For example, my RPi::WiringPi distribution pulls in 10 or so XS distributions (eg: RPi::I2C, RPi::SPI, RPi::DHT11). Instead of forcing users to install a whole crapload of distributions they don't need by forcing them to install the top-level one (which takes a relatively significant time to build on the platform it was designed for), they can just install individual components if that's all they need (SPI for example). There are benefits to installing the whole shebang, but that's only if you're going to use multiple pieces of the functionality.

If the two distributions can be used independently from one another (in your case it sounds like there are benefits to using them independently), they should, imho, remain separate.


In reply to Re: xs code in a perl module by stevieb
in thread xs code in a perl module by frazap

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.