I think the OP means "portable" in the sense "portable between otherwise equivalent machines with different sets of modules installed." That's a significant win; at a workplace, there will be dozens of desktop machines, and if you're writing scripts for other people to run, you have to be sure to only use modules that are available everywhere (or preinstall the ones you need everywhere.) But the base OS is still the same. I'm not going to worry about whether that fits a purist definition of "portable".

I wouldn't use the suggested mechanism because of the security concerns. But I might if the security concern wasn't there -- and as I read this thread, it struck me that it's fairly easy to remove: when requesting a module, request it using an exact version and a cryptographic digest. I'd probably want the digests to be listed in a separate file, both to avoid messing up the main script and to allow for dependencies. For any missing module, you'd download the requested version and check its digest before installing it. I know that CPAN can already check signatures, but that still relies on an external source for the signatures to check against. And I also like the notion that you could depend on getting the exact versions of things that you originally wrote your script against, so you don't need to worry about some module changing its interface out from under you.

It doesn't deal with the problem where a different version is already installed on the system, but it doesn't make that problem any worse either. It would just use whatever's there if some version existed, and you have no more than the usual version compatibility problems. It could even warn in such cases, which is better than what we get now.

Or think of it this way: you could bundle up a script with the complete source for all modules it uses, and it unpacks and installs them all when it first runs if they aren't already on the system. The proposed idea does exactly that, except it uses unfakable pointers to each module rather than the actual data comprising the module.


In reply to Re^2: Perl 6 Module manager by sfink
in thread Perl 6 Module manager by zer

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.