Fog Creek Software
Discussion Board




Why no CPANs?

How come almost no other programming languages have anything comparable to Perl's CPAN?

I'm not just talking about a small repository of scripts, I'm talking about a central, searchable, categorized repository of libraries scripts to do all sorts of common tasks, complete with documentation, unit testing, bug tracking, and ratings/reviews.

I've never ever seen anyone try to dispute the usefulness of CPAN, and everyone always puts CPAN and its modules towards the top of Perl's features list. So why is CPAN unique? Do programmers secretly *like* reinventing wheels over and over again?

The Baja revolution.
Friday, April 09, 2004

You're right CPAN rocks!

Someone tried to make a cross language one once, but it never took off: http://www.freepan.org/

CPAN is probably a result of the "get the job done" and extreme open source attitude of perl hackers.

Matthew Lock
Friday, April 09, 2004

How come almost no other programming languages have anything comparable to Perl's CPAN?

Python has something similar. Java ones are all just a bunch of JAR files in SourceForge so what's the point?

Li-fan Chen
Friday, April 09, 2004

Few but ripe.

Visual Gauss++
Friday, April 09, 2004

Li Fan- There's lots of things similar, but IME none compare to CPAN. I used to be amazed when I needed a specialized piece of software and found a module on CPAN. It's happened so many times now though, that I'm no longer amazed... I've come to expect it. Seriously, next time you need a specialized piece of software, just give CPAN a search. You might be pleasantly surprised!

  
Friday, April 09, 2004

Which came first, CPAN, http://www.cpan.org online since 1995-10-26 or CTAN, http://www.ctan.org (online since ??)?

mackinac
Friday, April 09, 2004

For the record, CTAN came first--that's where the idea for CPAN came from.

Since Perl's namespace system of hierarchal namespaces within namespaces (e.g., Net::FTP, Net::FTP::Common) facilitates this plethora of reusable Perl code, I guess another question would be why do language designers still resist this feature to this day (php, for example, had namespaces but they were removed from the language not long ago)? Why do so many languages either not support namesapces or only half-support them (like C++)? Do people like prefixing their identifiers with short, hopefully unique module names to avoid collisions (e.g., XML_ParseDocument() instead of just ParseDocument())?

The Baja Revolution
Friday, April 09, 2004

Cause name spaces add very little for the extra
complexity.

son of parnas
Saturday, April 10, 2004

Some languages allow you to provide a local namespace for an imported module, e.g. Python's "import xxx as yyy". This seems to be the best of both worlds.

http://www.informit.com/articles/article.asp?p=26983

Tom H
Saturday, April 10, 2004

When you're talking about CPAN you may actually be talking about one or more of three distinct entities:

1) CPAN the website: The primary website is http://search.cpan.org/ and all its links within to testers.cpan.org, rt.cpan.org and cpanratings.perl.org. (There are other sites, like http://cpan.uwinnipeg.ca/chapter .). This is what most people not so familiar with Perl and CPAN think about, but it really only scratches the surface.

2) CPAN the shell: This is a framework for installing modules, generally represented by the CPAN or CPANPLUS shells. The shell will find and install dependencies for you, fire off test results to the module authors if something fails, and a number of other tasks. This makes it possible for a large program (like the application server OpenInteract) to declare its dependencies and have CPAN install them as needed and is what enables the loosely coupled modules in CPAN.

3) CPAN the distribution network: When you want to contribute to CPAN you're given a PAUSE id -- Perl Authors Upload Server. To contribute a new module you go to the PAUSE website ( http://pause.perl.org/ ), login, and upload your module. (You can also of course script this.) That's it. Your module is then copied to hundreds of mirrors around the world, appears on 'new on CPAN' lists like http://search.cpan.org/recent (also in RSS at http://search.cpan.org/rss/search.rss ), and most importantly, is available for people to install via the CPAN shell or other tools that use it.

There are lots of tools that people have built to examine and support CPAN-the-infrastructure: what is the freshness of CPAN (new stuff vs old stuff)? how many modules have been created this year vs previous years? what modules are most declared in dependencies? and so on...

In the last couple of years the CPAN ratings system appeared ( http://cpanratings.perl.org/ ) as did the CPAN-wide issue tracking system RT ( http://rt.cpan.org/ ), automated reports from the CPAN testers community ( http://testers.cpan.org/ ),  and the CPAN tools (available from any module on search.cpan.org) which allow you to diff all files in a module to one of its previous versions.

What people who aren't familiar with CPAN don't get is that it's not just a repository. It's really the infrastructure that glues the Perl community together. This glue not only makes it possible for anyone around the world to contribute but also to painlessly build new modules that take advantage of work other people have done.

Me? I'm at: http://search.cpan.org/~cwinters/

Chris Winters
Saturday, April 10, 2004

There was some discussion on comp lang python a while ago about setting something similar up for python, but nothing came of it. I can't remember why, as I wasn't paying attention to that discussion, but it probably had something to do with it being better to have only one way to do things... :)

But I suspect it primarily comes down to size of user base. I bet more people use perl than use python, ruby and tcl put together.

Insert half smiley here.
Saturday, April 10, 2004

Several possible reasons, off the top of my head...

Age of the language (Perl is a bit older than the upstarts); so more time to get things organized and more time for the repository of code to grow.

Philosophy behind the language. Some languages (sad, but true) don't encourage reusing and sharing code the way Perl does. Flame me if you must, but there are lots more Java programmers but far fewer pieces of shared code. Most Java programmers aren't into this whole "contribute code back to the community" thing. Not criticizing, but I think it is true. Jakarta is a notable exception.

Just inertia on the part of the other languages. Like it or not, organizing something like CPAN takes a lot of time and effort. You need server resources (that won't go away in a hurry), you need people to think about and setup hierarchies of code and most important, you need a fair amount of code to get started.. or it wouldn't become a valued resource. Other languages have tried and their efforts are coming up to speed.. but it takes constant effort (CJAN ? anyone know where that went ? )

Automation and making it easy to build modules in the first place.. Module::Build and other modules generally make it much easier to contribute modules, even for someone who has never done it before.

deja vu
Saturday, April 10, 2004

*  Recent Topics

*  Fog Creek Home