On Thu, Mar 06, 2003 at 09:29:10PM +0100, Jochen Wiedmann wrote:
> Quoting [EMAIL PROTECTED]:
> 
> > The latest MakeMaker (snapshot on makemaker.org) will now generate a 
> > META.yml file as part of the distdir target, including adding it to the
> > MANIFEST.  The intent is to get module meta-data on CPAN without authors 
> > doing any work.  All they have to do is upgrade MakeMaker and then 
> > 'make dist' will Do The Right Thing.
> 
> I apologize, if my question is out of order, but is the use
> of YAML common sense on this mailing list?

Yes.

Forgive my terseness, but this discussion has already been done in all
possible permutations.  Below are the conclusions reached.  If you wish to
continue discussing, I'd be happy to do it in private but I really, really
DO NOT WANT ANOTHER XML VS YAML DISCUSSION.  Not on this list anyway.


> IMO YAML is a proprietary file
[format]

Its not proprietary, the spec is here:
http://www.yaml.org/spec/

The mailing list is here:
http://lists.sourceforge.net/lists/listinfo/yaml-core

We can change YAML the same way we can change Perl (ie. post a patch to the
mailing list, if they like it its accepted).  I cannot say the same of XML.


> with no particular advantage, except possibly human readability.

This is the advantage we want.  Human readability and writability.

Also the YAML data model maps directly to Perl.  YAML has hashes, Perl has
hashes.  YAML has lists, Perl has lists.  YAML has smart scalars, Perl has
smart scalars.  No mucking about trying to map trees into something sensible
in Perl.  It also maps well into Python and Ruby which will become
important later.

Finally, we are following what Module::Build does for the meta-data file.
They chose YAML so we use YAML.


> It is neither common, nor
> safe (considering strings with included colons, line feeds,
> or similar characters)

I don't quite understand what you mean by 'safe'.  YAML is just data it
doesn't get executed.  Maybe you could explain what you mean in private 
mail and we'll try to figure it out.


> or fast

The current YAML.pm is slow and buggy.  It will get faster and more reliable.
Trust me, I live with the author.  Have faith in Ingy.


> and has (IMO) structural limitations.

The yaml-core mailing list would probably like to hear about any limitations
you've found so they can figure a way around it.


> It isn't supported by any module in the Perl
> core, thus requires installation of external modules.

Well, its not in the Perl core yet...

Anyhow, YAML is very easy to write at the level we need.  Here's the code
MakeMaker uses.

    my $prereq_pm = '';
    while( my($mod, $ver) = each %{$self->{PREREQ_PM}} ) {
        $prereq_pm .= sprintf "    %-30s %s\n", "$mod:", $ver;
    }
    
    my $meta = <<YAML;
#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
name:         $self->{DISTNAME}
version:      $self->{VERSION}
version_from: $self->{VERSION_FROM}
installdirs:  $self->{INSTALLDIRS}
requires:
$prereq_pm
distribution_type: module
generated_by: ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION
YAML


Neither Module::Build nor MakeMaker needs to read YAML back in so we don't
need to depend on YAML.pm.  Only those who want to read it programatically
do.  Any format we chose would have the same caveat.


> As the desired task implies readability, I would consider other
> formats much more sensible, for example Perl code (using
> Data::Dumper)

Data::Dumper was rejected because its not terribly readable, it requires
we eval the code causing all sorts of security issues, and because its Perl
only.

Storable was rejected because its not human readable/writable, the format
is not stable across versions and its Perl only.


> or XML. (The latter has of course the same
> disadvantage of not being a part of Perl, but it is much
> more common, for example all ActivePerl users have it.)

XML was rejected because its more difficult for humans to read and write.  
And the data model (ie. trees and nodes) doesn't map well
into Perl.  Popularity is not relevant.

And because I'm not going to try to pretend this is a wholely objective
decision, I think XML is ugly and awkward.  Not trying to troll, just want
to be honest.  Some YAML vs <other> comparisons will appear here in a few days:
http://www.pobox.com/~schwern/talks/Y_I_Like_YAML/

Reply via email to