From: Brian I. <in...@tt...> - 2001-11-19 03:27:48
|
Just though I'd let you know that I've begun the Perl implementation of YAML. It is going to be sooo easy. Our spec is very nice. This should be a lot easier than Data::Denter. The interface for YAML.pm is going to be: use YAML; $YAML::Separator = '--foo'; $yaml = Store($a, $b, $c); ($x, $y, $z) = Load($yaml); # or for the OO geeks $y = YAML->new(Separator => '--foo'); $yaml = $y->store($a, $b, $c); ($x, $y, $z) = $y->load($yaml); I've got the Storer working a little bit. Here's a sample: > perl -MYAML -e 'print Store(bless [map {{$_, $INC{$_}}} sort keys %INC], "Foo::Bar")' --- YAML:1.0 !!Foo::Bar - Carp.pm: /usr/lib/perl5/5.6.0/Carp.pm - Data/Dumper.pm: /usr/lib/perl5/5.6.0/i386-linux/Data/Dumper.pm - Exporter.pm: /usr/lib/perl5/5.6.0/Exporter.pm - XSLoader.pm: /usr/lib/perl5/5.6.0/i386-linux/XSLoader.pm - YAML.pm: /usr/lib/perl5/site_perl/5.6.0/YAML.pm - overload.pm: /usr/lib/perl5/5.6.0/overload.pm - strict.pm: /usr/lib/perl5/5.6.0/strict.pm I've been starting a list of YAML options. So far I have: $YAML::Separator = '---'; $YAML::UseHeader = 1; $YAML::UseVersion = 1; $YAML::SortKeys = 1; $YAML::FirstAnchor = '0001'; $YAML::ExplicitTypes = 0; $YAML::WidthType = 'absolute'; $YAML::MaxWidth = 0; $YAML::BestWidth = 80; After a few different implementations, we can discuss any standardization we may wish to do. I don't think it's that important really. Last night I went to a party. The funny thing is that almost all my potential YAML implementors showed up: Paul Prescod - Python/Adviser Neil Kandalgoankar - Python Jeff Hobbs - Tcl Shane Caraveo - PHP I plan on making the Perl implementation very readable (not a lot of optimizations) so that it will be easy to copy by the others. We'll get the speed when the C implementation is ready. |