Nor is it pining for the fjords.
First sign a technology is dying: supporters start writing articles stating [technology] is not dead.
Ron Savage asserts on my blog:
Whether you like YAML or not, it’s effectively dead and gone. Accept this reality and forget it.
- No supporting argument
- No Link
- No alternative evidence
It’s the first time I’ve heard anyone say this, and normally I’d dismiss a naked assertion like this out of hand. But I’m not too invested in YAML at this point (although getting more invested all the time) and it is probably worth a few minutes digging to avoid several months of time wasted. Whether it is worth the extra minutes to write this blog post is debatable however
So first of all I search at duckduckgo.com for "YAML is dead". None of the first 30 links I glance at are talking about YAML’s moribundity.
Next I look at Stack Overflow. 170 questions tagged YAML vs 3,554 tagged JSON (10,978 tagged xml). But I’m not particularly worried about popularity, otherwise I’d be using Java over Perl right? A lot of the YAML questions are fairly recent and have responses.
That’s enough for me. It has parsers, a perl module and it looks far nicer than JSON. I’m going to stick with it.
I guess Chris Hardie would say you are “reinforcing the frame.”
http://www.chrishardie.com/tech/perl/framing-lightning.pdf
Actually YAML is a terrible technology and it probably should die.
The fact that isn’t truly cross-library and cross platform makes it difficult to deploy. The fact that unicode is handled in a very spotty manner is another reason.
There is no kind of data schema support so both us have to communicate and agree before hand.
There’s no clear method for encoding arbitrary data (even XML fails here, you can’t encode 1-byte nulls (4 byte nulls are possible) (you can also declare before hand that an element uses base64 but that won’t be checked in the DTD). There’s !!binary but that’s just rather unsupported.
Even worse why is gone and so is slyck. Whatever remains of slyck is half-assed and not done.
Did you see the datatypes they tacked on later?
One of the only thing that yaml has over json is that objects get named and tagged with a class. Json is idiotic this way, always requiring an agreed upon protocol to determine the type of an element.
Also when was the last time your YAML parser actually handled the relational data?
YAML is:
* Ill defined
* Half implemented
* Poorly thought out
* Poorly patched
* Poorly supported
* Complicated to parse with all these exceptions
* Not XML
* Not JSON
* Neat idea but poorly designed
* Half-dead
* dying
Personally, I think YAML got its legs broken because it hasn’t paid its syntax loan, but that’s just me.
It’s not dead, it’s just painful.
@Tim – Nice link. I hadn’t seen that talk before. It does make sense to speak positively rather than disgreeing with the disagreeable.
@Anonymous – thanks for providing an extensive argument against YAML. If I understand you correctly, you’re mostly arguing that YAML should die because it is unsuitable as a transport format.
I think I’m good – that isn’t what I want to use it for. I want to use it for configuration files. Datatypes and arbitrary data don’t matter to me (well, until I find a value I need that I can’t encode of course!)
Some of your points look either irrelevant, a good thing, or uncorroborated (apart from in comments here)
* Not XML
* Not JSON
* Half-dead
* dying
And why does why matter?
@Curtis – I guess you’re talking about the alternative syntax to syntactically significant whitespace. As long as I’m not using it as a transport format, I suspect I won’t use the alternative syntax.
I’ve been using YAML for years in various programming languages and have never read about its death until Ron, so I don’t believe it a bit.
True, the YAML specification is complex and many parsers are partial implementation. Perl support is patchy, but as long as you pay attention to a few gotchas and do not wander too far into esoteric features, I think you’re safe exchanging data between Perl, PHP, Ruby, Python, etc.
YAML is:
- convenient to type by hand
- nice to look at, very human readable
- quite easy to learn (although not as easy as JSON)
- not XML (a good thing)
- available in Python, Perl, PHP, Ruby, etc
- not necessarily painful at all
Who cares if it’s a bit hard to parse, unless you’re a parser writer? Is XML easy to parse? Na ah. Is Perl easy to parse? Not at all. Let cheap CPU cycles parse the hell out of it, if it conveniences us humans, it’s a win.
As for schema, YAML is just a serialization format of data structures, for goodness sake. Do you require a schema for Data::Dumper, Storable, PHP::Serialization? Just validate and check your data structure in whatever way using whatever module you like.
If you hate YAML, don’t use it. But don’t spread FUD and lies about it. It does its job well. No technology is perfect.
Now that I read it again, Audrey Tang did write this in YAML::Syck’s POD:
“Consider using YAML::XS instead, or not using YAML at all. YAML is falling out of style in the Perl community in favor of simpler formats like JSON, which don’t suffer from the bugs and annoying incompatibilities that plague the ambitious YAML format.”
so maybe that’s one source for the “YAML is dead/dying” meme.
I have also been annoyed by the incompatibilities, but so far I still use YAML because currently there’s just no other format that’s quite nearly as nice.
When I need to maintain the type of object that I’m dumping, I use YAML instead of JSON. However, Ingy showed my JSYNC (JavaScript and YAML Notation Coding) which uses JSON in a pseudohash sort of way to do the same thing. I haven’t tried that yet, but he tells me that you can go back and forth from JSON and YAML with no loss of features.
You might also see my recent YAML versioning problem: “block sequence entries are not allowed in this context”
The Creator of YAML is working on a new format,
http://jsync.org/
Not that I experienced that myself – but I remember how YAML got out of favour at the Catalyst mailing list (it was initially the default config format) because of repeated emails asking for help in debugging some obscure YAML behaviour.
@Steven – yeah, this post has brought out a few guys who aren’t keen on YAML (but I think they use it – maybe it is wishful thinking). I was surprised that anyone would dislike it, but that was before I saw the alternative exclamation-mark-ridden syntax. It isn’t as clean as the whitespace sensitive version but perhaps still better than JSON.
@brian – thanks for providing a bit more context. And there was me thinking that it was just a nice configuration file format (just kidding – I saw the spec but didn’t bother reading it too closely).
@brian & Kiran – thanks to the link to JSYNC – looks interesting but I’ll probably stick with XML for my transport protocol for no other reason than the fact that it is pervasive throughout my firm.
@Zbigniew – Has JSON replaced YAML within Catalyst then? I’m not a user.