Hi all,

Currently in CPAN you have modules like:

Digest::MD5
Digest::SHA
Digest::MD5::Perl
Digest::SHA::PurePerl

The difference is that the first two are implemented in C and the later two in Perl.

Naming issues are likely to become worse in Perl 6 when we also have modules that use Parrot. You might have three implementations of Digest::SHA, one in Perl 6, one that uses Parrot, and one that uses C. Worse, you might even find a module that depends on both Parrot *and* C.


I think we might need to come up with some sort of standard naming convention to distinguish dependencies. Something that the *user* can recognize quickly when he browses CPAN. My first thought was:

P6::Digest::SHA
C::Digest::SHA
Parrot::Digest::SHA

But that does nothing for modules that require both C and Parrot (it sounds horrendous, but I bet *someone* will do it). And btw, this isn't just to help users pick the right module. The modules do need different names to avoid naming conflicts.

One idea is to introduce a non-alphanumeric character to separate dependencies. For example:

Digest::SHA    <-- No dependencies. Just Perl.
Digest::SHA/C  <-- Requires C.
Digest::SHA/Parrot <-- Requires Parrot.
Digest::SHA/C/Parrot <-- Requires C and Parrot.


Remember that in Perl 6 modules can be named with any Unicode character, so "/" is fair game. I am not proposing a change to the language. Just a naming convention using characters that the language already allows.

There are other possible symbols besides '/'. All in all, I think my favourite options are (in no particular order):

Digest::SHA/C           Digest::SHA/Parrot
Digest::SHA!C           Digest::SHA!Parrot
Digest::SHA+C           Digest::SHA+Parrot
Digest::SHA.C           Digest::SHA.Parrot
Digest::SHA~C           Digest::SHA~Parrot

What do you think?

If anyone can think of a symbol that is already used in Perl with a similar meaning, please let me know.

Daniel.

Reply via email to