John Siracusa wrote:
1. The special dir of files (SDoF).  Ignoring, for now, the argument for a
standard way to do this, all the core needs to do to bootstrap an entire
ecosystem of app packagers is support some standard starting point.  Maybe
it's a file names main.pl inside a *.pmx dir, or whatever.  But there needs
to be something, otherwise every SDoF system will have to bootstrap itself
using some executable other than perl (e.g. PAR/parl)  I think that's much
less elegant.
We can, and I think should, write a one-paragraph documentation, one-screenful implementation of this that's in perl core:

  As a special case, if the "filename" argument to perl is a directory,
  and the directory contains a file named "main.pl", then the directory
  is prepended to @*INC, and main.pl is run.

2. The single-file, packaged version of the SDoF (SDoF Package).  Too
boostrap this, the core needs to know what to make of such a file.  Maybe
nothing needs to be done if a #! line and some plain old perl code at the
start of the file is sufficient.  But something tells me that a bit more is
needed to unzip/untar/whatever the rest of the stuff in the package file
before execution.  Trying to inline pure perl unzip/untar at the header of
each SDoF Package file doesn't seem elegant to me, but it could be
technically possible to bootstrap that way using only the perl 6 executable.
We can support this in several ways. We can say that core perl also supports the above if the file is a gzipped tar file, and contains a main.pl (including adding the archive to @*INC). We can ship a script with perl, and have the user use the #! mechinisim to run it, with the actual file being specified to be a #! line, ending with some combination of CR and LF, then a tarball.

This is probably a lot more work for perl core, but would be quite nice.

3. The single-file, platform independent, non-source executable (P6exe).
This is bytecode or some other platform neutral representation of the SDoF.
I just don't see how to do this at all without core support.
Parrot supports this well enough that it will be hard for perl6 to mess it up. Parrot, indeed, already supports...

4. The single-file, platform dependent, machine language executable (realexe). This is a plain old executable, that does not particularly indicate it was generated by a "scripting" language. It requires no odd handing vs a normal executable for the target platform, because it /is/ a normal executable for the target platform. It may be staticly or dynamicly linked to the necessary libraries.

Based on the little I know of JAR, the three features listed above seem to
extend a bit beyond JAR in both directions, and each either require or
should have some amount of core support, even if only to bootstrap community
implementations.
Mostly, though, they require fairly minimal support from the core. Only 1 requires C<perl> support, and that support is very minimal. The others require standard-library support, but all the major bits are things that should already be in the standard library (because a front-end to C6PAN should come with, and that means extracting some sort of .tar.gz files -- calling out to external utilities doesn't cut it too often).

        -=- James Mastros

PS -- Unreatedly, why, oh why, do people insist on an apostrophe in 80's and postfix:'th? It's 80s and postfix:th!

Reply via email to