Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

ferreira (5993)

  (email not shown publicly)

Just another Brazilian Perl hacker.

Journal of ferreira (5993)

Sunday December 25, 2005
07:20 PM

New breath for YAML in Perl

[ #28125 ]
This Christmas had seen the release of two YAML-related modules which are bound to advance YAML support in Perl. First, Audrey Tang released YAML::Syck 0.01 . And then YAML reached 0.49_70. Indeed, both (if I understood correctly) were inspired by the recent joint work of Ingy döt Net and Audrey, which took shape as code. They are the ones who should be doing such an announcement, but I am so eager to see complete/bug-free support for YAML that I could not resist to broadcast my salutation to these two outstanding Perl developers.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Is there anything YAML does which is not better done using one of XML, JSON [], Data::Dumper [], or Storable []?

    • When used for JSON-subset problems, YAML is far more readable for ordinary humans... Secretary-level readable even.

      So YAML can be very very useful for config files (when .ini isn't enough any more) and spitting out reports.

      But as for the rest... I don't see anything shiny (unless there's something in the whole streaming thing I'm missing).

      • Yes, YAML’s syntax in the most basic form is very readable. But how writable is it at this point? It seems like YAML started out as a very cool config syntax that got out of hand due to serialiser envy, and subsequently grew a lot of syntax I have no use for in config files as well as a bunch of Perl-centric features that alienate other dynamic language communities. At the same time it does a bad job at non-trivial serialisation.

        It’s a pity, because I was shopping around for “wiki markup

    • Well,
      • XML is (1) sometimes too verbose, (2) has an underlying model node(name, attributes, children) which doesn't map directly to Perl, (3) (on the pro side) has a very simple core and (4) is massively popular nowadays
      • JSON is (1) YAML with only inline collections - easily unreadable and (2) looks like Lisp (but with braces and square brackets). (3) Also very simple. (4) On vogue due to AJAX hype
      • Data::Dumper spits Perl - (1) Perl is good, but not necessarily easy, (2) not simple at all, but powerful
      • Stor
      • No no no. I mean, name any particular task, then tell me why YAML does this particular task better than any of the other choices. Just listing upsides and downsides of each particular choice is pointless.

        As I conceded in the other post, as a debugging aid and for report generation, it’s good. But what else?

        • "Tell me why YAML does this particular task better than any of the other choices." How can I say such a thing? I can tell you that I already used YAML in pretty complex configuration files, with lots of metadata, and that was handy to write YAML rather than fussing around with the program source. But so I did with XML as well. And I have had the chance also to save YAML into databases as a portable way to load/dump structured data in plain strings/clobs stored in relational tables. But I don't claim it was
        • The original poster had a key point -- YAML is simple and safe. (I won't wade into whether it's as simple as it used to be or simple enough.)

          YAML does NOT use EVAL, so it's safe for cases where you don't want to trust the persons who might tweak the file.

          YAML does not pretend to be readable Lisp, and thus doesn't drag in XML::Parser or other XS modules. If I want matching brackets, I'll use real lisp, thank you very much. (The latest announcement says you CAN have an XS module if you need speed, but why wou
          # I had a sig when sigs were cool
          use Sig;