Categories

Posts in this category

Fri, 22 Oct 2010

How core is core?


Permanent link

In the Perl 5 world, "core" modules are a big topic. Some people can't (or think they can't) install any modules beyond "core", and suggest to add more useful modules to "core". Others think that we should have fewer core modules, to reduce the maintenance load on the perl 5 porters.

So, what's the deal in Perl 6? which modules will be "core", and who decides? Will we learn from Perl 5's mistakes, whatever you consider them to be?

To answer that question we have to explore what "core" really means. In Perl 5, it's just a module that's included in the "perl" package that's uploaded to CPAN. In Perl 6, there are several possible meanings:

  • A type that's available to any Perl 6 program without loading anything (A)
  • A module that ships with all Perl 6 compilers (B)
  • A module that ships with a Perl 6 distribution (C)

Note that all three concepts known in Perl 5 too - UNIVERSAL is category A, warnings is category B, and there are some modules that are installed by default by ActiveState Perl or Strawberry Perl.

The Perl 6 specification talks about category A core modules in the S32/Setting Library documents. Currently things like DateTime, Date and IO::Socket::INET fall into that category. Maybe someday they will be automatically loaded on demand, to cause less strain for all programs that don't use them.

Category B is currently rather sparse, it only consists of Test.pm (and in the case of Rakudo also Set.pm, but that should eventually become a category A core module). This is where we learned from old mistakes: keeping compilers and distributions separate reduces the maintenance load for the compiler writers. Do you as a user want a module installer? then you should be installing a distribution, not just a compiler

Everybody can start their own distribution, based on any existing compiler. That's a good thing. Whoever maintains a distribution gets to decide what to ship with it. Currently the Rakudo developers both write a compiler (commonly referred to as Rakudo), and a distribution called Rakudo Star. The compiler will continue to ship with very few modules, the distribution will adapt to the need of the users.

I fully expect there to be specialized distributions in the next few years or decades: maybe a sysadmin distribution, a web developer's distribution and so on. Or maybe that specialization will be realized by bundles. We'll see.

Perl 5 also has "dual-life" modules, which are both released to CPAN and are part of the core. Since Perl 6 has almost no type B core modules, there will be almost no need for dual-life modules either. I expect that most distribution makers will rather import modules that are maintained by third parties, rather than maintaining them on their own - kinda like Linux distributions package popular and useful software, but only actively maintain it in rare cases.

[/perl-6] Permanent link

Comments / Trackbacks:

Trackback URL: /blog-en/perl-6/how-core-is-core.trackback

Michael Peters wrote

Problems with Category A-only modules
Using DateTime as an example, I can see real problems when it's included in the core as an A module with no way to update it without updating your compiler too. What if a country passes a law that changes their timezones? What if a bug is fixed in the module that directly effects your work? Do you need to wait for a new version of Perl 6 and then completely upgrade your environment just to get a bug fix for one module?

Moritz wrote

Config files?
Why not just store timezone information in config files, so that a changed timezone is just reflected in a changed config file?

Andreas wrote

The real question
Hi

I don't think that the question is "How core is core?". The questions are:
* "What is aboslutely neccessary?"
* "How easy do I get a module if it isn't installed?".

To answer the first question: I think modules that are used a lot, especially if they have to be compiled agains binary libraries. Also modules that make it easier to handle deal with modules that are not installed.

To answer the second question: The easier it is to install modules for non admin users the less core is required.

Imagine a web server were I want to use a certain module. If the module is already installed, I do not have a problem. Either because it is core or it comes with the installed distribution.
What if it isn't installed. If I simply can copy the module to the server I don't have a problem. If I have to compile it it gets a lot harder.

Or imagine my work environment. I work in a datacenter with windows and up to five unix/linux distributions. Every of these distributins comes in up to three versions (e.g. realy old SLES9, SLES10 and SLES11). So if I write a script that should run on all systems and needs a module I have to ensure that it runs on up to 15 different installations.

So I hope something like PAR will be part of core and that there isn't the need for compiled modules.

Write a comment

The comments on this blog post have been disabled; the comment form below will not work.

 
Name:
URL: [http://www.example.com/] (optional)
Title: (optional)
Comments:
Save my Name and URL/Email for next time