Perl 6 and CPAN? Well…

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 🙂 .

This entry was posted in Think Tank and tagged , , , , , , . Bookmark the permalink.

3 Responses to Perl 6 and CPAN? Well…

  1. tleich says:

    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.

    The presence of a META6.json makes the distinction between a Perl 5 and a Perl 6 dist.

    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.

    When a Perl 6 dist is detected it is put into a Perl6 subdir of the authors home directory. This was done to be able to only rsync Perl 5 or 6 respectively, or to make it easy to detect a Perl 6 tarball for cpantesters.
    After the dist hit the home directory, there is no indexing yet for Perl 6, but I am about to make a PR to get sane indexing in place. (I requested database tables atm, and when these are there I’ll PR the indexer.)

    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.

    AFAIK it uses the META.json/META.yml for Perl 5 to get the repositories link and the bugtracker. And we will do the same with our META6.json.

    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.

    Isn’t that the fact already with search.cpan.org vs. metacpan.org?

    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.

    That is the reason we (will) have a different indexing scheme.

    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.

    I do not bye this argument. The ecosystem does not work well. You do you do a release at all? There is no way to release anything but git/HEAD from github. And we can’t let it be that way any longer because if you make a breaking change, the dists that use your dist cannot say that they rely on an older version. If you update distsvia panda, things will break and you will not get around that.

    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.

    My vision, after we have pause and its gazillion mirrors, would be a marketplace.perl6.org which has more an App-Store/shop like interface for the user. I do not think that search.cpan.org will turn into an interface for Perl 6 dists at all. And I do not really see the benefit (atm?) that getting searh results for Perl 5 and Perl 6 at the same time helps anybody.

    • lueinc says:

      Just about every point you make is based on stuff that started at the meeting in France(?) about S11 and S22, which this post was made before occurring 🙂

      However, there are two points here: first, I agree the ecosystem isn’t perfect (or that great), and at the time I was looking at search.cpan.org, I found nothing in the way of standardized links to external repos or bug trackers. I should look again, but to me search.cpan.org doesn’t offer much more than the ecosystem. Could be wrong there though 🙂 .

Leave a comment