Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Perl programmers have CPAN. It's a repository of modules for all sorts of problems and solutions, interfacing with various technologies, network protocols, and file formats, adding features to the language, and a very long list of other ready components. In a way, it fulfills the dream of object-oriented programming people, and really any programmer, of having a generic and complete library of all written modules so far that can then be used in solving new problems.

This is an ideal situation. How many Perl progammers realize it? It's not only about saving time and effort, or enabling you to use technologies that you don't have time or interest to learn, or the ability to create well-nigh trivial solutions with just the right choice of modules, or having the largest repository of modules to brag about. It's all this and a realization of an old ideal. With sugar on top.

There's only one problem with it: it's Perl only.

Other programming languages do have "comprehensive archive networks" -- frequently modelled after CPAN itself (which, in turn, was modelled after CTAN). With some googling, I was able to locate the following archives of reusable modules for different programming languages:

Network Archived technology Year founded Approximate size (Oct 17th, 2007)
CTAN TeX 1992 7.5 GB (probably including different versions)
CPAN Perl. Of course. 1994 4 GB, 12345 modules
CRAN R 2004? 1197 packages
CEAN Erlang 2006? 212 packages
CKAN Open Knowledge Definition 2005 112 packages
JSAN JavaScript 2005 A few dozen?
CSAN Scheme 2004 0 packages(?)
cCLan Lisp Some time after 2000? ?
PLaneT Scheme ? Around 270 packages
ASDF-Install Lisp ? Around 360 packages

(Well, Open Knowledge Definition is not a programming language. TeX is, in a way. Is it Turing complete?)

The main problem is duplication of effort, something these archives try, by definition, to reduce! But there doesn't seem to way a out of the dilemma: how do we create a repository of generic, truly reusable software modules that are language-agnostic? There is no inclination of the world converging to one single programming language, so picking one "universal" programming language is not an option.

Perhaps there could be an archive targeting a universal virtual machine. Although there would have to be consensus on the machine architecture first (I propose the SECD machine), imagine that all programming languages had compilers that could target the virtual machine. The packages in this imaginary archive would have two versions: the source code and binary machine code for the virtual machine. Then, depending on if you have the compiler, or the language runtime environment, installed or not, an automatic install tool would pick either the source code of the program or the binary version compiled to the virtual machine.

Benefits: as long as source languages had compilers, modules could be written in any language, in principle. Even if you had never heard of the language before, you could still use the virtual machine code bundled with the module.

The obvious drawbacks are having to rely on machine language again, even if it is for a virtual machine. Another is the complexity involved, and duplication of effort in terms of compilers.

Any other ideas? I don't really accept "but Perl is a universal language!" as an answer, at least not until Perl 6 exists.

Update: omouse pointed out more Scheme and Common Lisp archives, which were added to the table: PlaneT and ASDF-Install. The latter seems to even be hosted at CLiki, which is where cCLan can be found too... Sorry for the oversight.

print "Just Another Perl Adept\n";

In reply to Truly reusable software components by vrk

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2021-08-02 19:58 GMT
Find Nodes?
    Voting Booth?
    My primary motivation for participating at PerlMonks is: (Choices in context)

    Results (29 votes). Check out past polls.