News for hackers. Stuff that matters.
Re:Bugs in the YAML specification by crdoconnor on Sunday September 04, 2016 @02:35PM (#12425940)
Despite being a nice readable language if you use it right, the spec is rife with disgusting features and nasty surprises.

This was my attempt to cut out 90% of the crap, leaving the nice, readable core (which maps on to JSON pretty neatly):

https://github.com/crdoconnor/strictyaml

Re:Bugs in the YAML specification by akkartik on Sunday September 04, 2016 @07:23PM (#12427208)
I love the example at https://github.com/crdoconnor/strictyaml/blob/master/FAQ.rst.... Convinced in 2 seconds that full YAML is idiotic.
Re:Bugs in the YAML specification by guitarbill on Sunday September 04, 2016 @08:26PM (#12427412)
this whole idea of strictyaml just makes so much sense to me. plus having comments is a huge bonus. why am i only hearing about this now?
Re:Bugs in the YAML specification by scrollaway on Sunday September 04, 2016 @09:07PM (#12427536)
You're hearing about it now because 99+% of people who use YAML have no idea about how horrible the spec is. They just assume that it's like what strictyaml strives to be and don't understand why "such an elegant, simple and readable language isn't used more".

In other words, people don't understand the need for it. Those that do use other formats - json or toml, namely.

Re:Bugs in the YAML specification by MasonOfWords on Sunday September 04, 2016 @09:01PM (#12427525)
The FUD here is a bit ridiculous.

Writing movie scripts in YAML using unquoted strings? That's pretty contrived. Using literal style is easy when it is potentially needed (e.g. programmatic output), and any decent editor can highlight inferred types in helpful ways. I've used YAML in a variety of contexts and never been bitten by this one, and I don't think that any of his examples are still problems in YAML 1.2 (from 2009).

The Ruby security problem they reference is also absurdly misattributed. The problem there is with trusting serialized data to mark its own types, and having no limits on what types can be deserialized into. That's a depressingly common security problem in many web frameworks, and YAML as an interchange format isn't a unique source of vulnerability. Any data format is dangerous on the web if you trust it to create arbitrary types.

Re:Bugs in the YAML specification by sirn on Monday September 05, 2016 @04:58AM (#12429011)
I read that and thought, hey, it couldn't be that bad, right? Then proceed to type:

    irb(main):002:0> YAML.load("on: yes")
    => {true=>true}
Oh.
Re:Bugs in the YAML specification by jean- on Sunday September 04, 2016 @06:17PM (#12426989)
Very nice! Another saner alternative to YAML which I like is TOML: https://github.com/toml-lang/toml
Re:Bugs in the YAML specification by voaie on Monday September 05, 2016 @04:16AM (#12428870)
TOML don't even have a clear and definitive standard/test suits. It seems unmaintained but some people are trying to push it to 1.0 no matter what.
Re:Bugs in the YAML specification by crdoconnor on Monday September 05, 2016 @06:31AM (#12429323)
I actually went over why I'd consider this is a better format than TOML:

https://github.com/crdoconnor/strictyaml/blob/master/FAQ.rst...