So, just earlier today the issue of putting Perl 6 modules (and other assorted things) on CPAN came up. I feel that it’s pertinent to put all of my concerns with this now, instead of waiting until people are in the middle of actually implementing this.

Why not just put the modules on CPAN and be done with it?

Sure! Let’s go ahead and right now upload some of the more well-known Perl 6 modules, like File::Find, Shell::Command, and JSON::Tiny.

Oh.

Yeah, that’s not happening. Perl 6 and Perl 5 are incompatible languages, at least enough so that sharing one universe of module names is absurd.

Why not just prefix Perl 6 modules with Perl6:: ?

You mean Perl 6 module-writers do this for each and every one of their modules? No.

You mean CPAN puts a fake Perl6:: in front of modules for organizational purposes? Alright. Sure hope no existing CPAN modules use Perl6:: as an actual namespace.

Oh.

We could implement all the workarounds we want, but really it would be best for everyone’s sanity if we just maintained separate Perl 5 and Perl 6 worlds.

Other issues

OK, so why not just separate the two worlds on the CPAN servers? Fine, but there are other issues that then come up in the process.

PAUSE needs new scanning tools

Namely, PAUSE currently check a tarball’s .pm files for packages given, which clearly won’t work with Perl 6. A script that analyzes an S11-compliant META.info would suffice here.

CPAN needs more metadata, and be more like typical package managers

Have your own, non-CPAN bug tracker? Have a repo that contributors can, uh, contribute to? CPAN’s current solution is to “check the documentation of the module”. I believe this is unacceptable, especially considering how atypical (wrt CPAN) Perl 6 does module distribution. CPAN needs to have “source code” and “bug tracker” links that point to the right place.

In fact, I’d prefer it if CPAN were more like various package manager sites for various Linux distros. That is, more than a place designed to give free tarball hosting space to Perl developers. It should at the very least provide a standardized, metadata-based external link to some sort of homepage.

This brings up a more general issue: S11 and related are designed to specify a full package management system, something much closer to those OS package managers. Granted, I am not at all familiar with Perl 5, much less CPAN, but it just feels like a bare-bones “only what’s needed to install modules easily” kind of thing, which Perl 6 goes beyond. CPAN was built around how Perl 5 does packages; how Perl6 does packages is designed around what package managers typically do.

The most prominent difference between how Perl 5 works with packages and how Perl 6 works with packages is in authority and versions. CPAN and PAUSE are responsible for handling versions, Perl 5 does not handle this. Additionally, module names are owned by one (or more) people, specified by the same infrastructure.

In Perl 6, the version and authority are a part of the package itself. It makes little sense to place restrictions on what names you can use, or have a “upload tarballs only once” policy that requires versioned tarballs.

The versioning shouldn’t be too hard to fix; most tarballs tend to be versioned anyway, but with version info in the module, instead of near it, PAUSE can’t rely on versioning of tarballs anymore, at least not for Perl 6.

The author part is harder; since anyone can create a module with an existing name, so long as they aren’t the same author, this destroys the idea of various people “owning” a particular module name. Where in CPAN I have to explicitly request the ability to update Shell::Command from the right sources, in Perl 6 I can just make a module with that name, that holds the updates (a.k.a. “forking”). I imagine this isn’t easily fixed unless CPAN/PAUSE6 are effectively totally separate from the 5 versions.

Finally…

So, with the need to maintain separate worlds for Perl 5 and Perl 6, and to significantly alter CPAN itself (esp. the interfaces) for the kinds of things Perl 6 is designed for, the question arises: why doesn’t panda and the ecosystem work well enough already? Sure, CPAN offers a nice place to host tarballs, but aside from that, I think the existing infrastructure that Perl 6 has works. From my view, this would be nothing more than a name change, one that’s of questionable value.

Just to be clear, I’m not totally opposed to a move to CPAN (in fact it would likely give the Perl 6 crowd some much-needed structure in their module distributions). I just have some serious misgivings about what this move would entail, and on some level why putting it all under the CPAN name is better than just putting it under a different name, especially if the two languages would be so separate.

However, I would love to be convinced otherwise, that CPAN would be awesome for Perl 6. This is simply the opinion of someone who’s used cpan all of once or twice for the odd Perl 5 script that needs to be run, and has been able to get along in Perl 6 just fine without CPAN so far.

Additionally, because I believe in lighting candles when it’s dark, I’ll do my best over the next few days to design a mockup of my idea of a Perl 6 package manager, to better illustrate why I’m not sold on CPAN as it is. (Yes, this will most likely revive one certain idea, if maybe not quite in name :P)

Also, mostly as a matter of principle, I refuse to use PAUSE until I’m not forced to give out my full real name. I just don’t see the point of that, and I’m not very liberal with any of my personal information unless it’s absolutely necessary 🙂 .