News for hackers. Stuff that matters.
Re:Hjson, the Human JSON by mamikonyana on Thursday April 14, 2016 @12:43PM (#11498228)
Re:Hjson, the Human JSON by alanh on Thursday April 14, 2016 @05:07PM (#11500354)
YAML is more complex that most people tend to realize. (This was brought up in a 2011 discussion about possibly standardizing a metadata section for Markdown documents which sadly went nowhere. [1])

Take a look at example 2.11 in the YAML spec [2], for example, and see if you can make heads or tails of it.

[1]: https://pairlist6.pair.net/pipermail/markdown-discuss/2011-A...

[2]: http://www.yaml.org/spec/1.2/spec.html#id2760395

Re:Hjson, the Human JSON by detaro on Thursday April 14, 2016 @06:08PM (#11500718)
pyYAML has this collection of problems with the spec: http://pyyaml.org/wiki/BugsInTheYAMLSpecification

(and pyYAML itself can't always parse its own output correctly...)

Re:Hjson, the Human JSON by crdoconnor on Thursday April 14, 2016 @05:56PM (#11500639)
You don't need most of those features. A pared down YAML with the cruft removed (implicit typing, flow style, tag tokens, node anchor & references) is actually pretty simple as well as less "gotcha-y".
Re:Hjson, the Human JSON by __david__ on Friday April 15, 2016 @03:57AM (#11502853)
Sure, but most language YAML parsers support all or most of the spec. That can be a problem if you aren't expecting it.
Re:Hjson, the Human JSON by alanh on Friday April 15, 2016 @07:11PM (#11508311)
I believe it has even created security issues. Didn’t Rails have at least one YAML-based vuln?
Re:Hjson, the Human JSON by rurban on Sunday April 17, 2016 @12:19PM (#11515039)
You need to restrict YAML to SecureLoad, with manually adding allowed typed and classes.

At least perl doesn't support this, so it's inherently insecure there, but you can always use YAML::Syck which didn't go this way.

Re:Hjson, the Human JSON by TranquilMarmot on Thursday April 14, 2016 @03:46PM (#11499780)
From hjson.org:

"YAML expresses structure through whitespace. Significant whitespace is a common source of mistakes that we shouldn't have to deal with."

Re:Hjson, the Human JSON by jholman on Thursday April 14, 2016 @03:58PM (#11499863)
Okay, does anyone actually believe that causes a problem?

I can think of ONE time when that causes a problem, and that's with indentation with multi-line strings. Oh look, HJSON included that feature. That's like throwing the baby out and keeping all the bathwater.

Re:Hjson, the Human JSON by gboone42 on Thursday April 14, 2016 @06:32PM (#11500825)
I can't find a specific example off the top of my head but I'll say I've been managing a Jekyll site for a while now and whitespace errors in frontmatter and data files cause all kinds of problems. I'm not sure I could explain the details but it's a legit criticism of YAML. IMO part of the problem is that YAML looks very straightfowrard and is until it suddenly isn't. Whitespace is part of that problem.
Re:Hjson, the Human JSON by kaishiro on Friday April 15, 2016 @12:36AM (#11502190)
As an anecdote on the flip side, I've been building Middleman sites for a while now and can't remember ever having an issue with whitespace in the front matter or local data.
Re:Hjson, the Human JSON by BobTheCoder on Friday April 15, 2016 @12:18AM (#11502111)
Yeah I'm with you. Developers should have no problem dealing with whitespace and the result is you get a easier to read format.

Although admittedly I haven't had to work with YAML a lot but I have liked it when i've touched it.

Re:Hjson, the Human JSON by bpicolo on Thursday April 14, 2016 @01:45PM (#11498881)
yaml has any number of ambiguous cases
Re:Hjson, the Human JSON by andrei_says_ on Thursday April 14, 2016 @04:32PM (#11500102)
Could you provide some examples?
Re:Hjson, the Human JSON by bpicolo on Thursday April 14, 2016 @08:19PM (#11501235)
Unquoted strings are valid in yaml just like this format. There are at least 2 ways to specify a list of things. There are some super bizarre looking possible formats for lists of mapping types.

There are a number of others given the length of the spec. Yaml is a complicated beast that generally has more than one way to do any given thing