News for hackers. Stuff that matters.
Re:Cargo, Rust's Package Manager by Svip on Tuesday June 24, 2014 @04:14AM (#7936660)
I may not be a majority here, but I see JSON as a data transportation format, while I see TOML or YAML as configuration formats.

You cannot write comments in JSON, for instance.

Re:Cargo, Rust's Package Manager by riquito on Tuesday June 24, 2014 @06:32AM (#7936964)
You're not alone. YAML or similars are the right formats for these things, not JSON. Less clutter, comments separated from data, easier to read (by humans).
Re:Cargo, Rust's Package Manager by progx on Tuesday June 24, 2014 @05:46AM (#7936864)
Example from the website in json

    {
      'package': {
         'name': 'hello-world',
         'version': '0.1.0',
         'authors': [ '[email protected]' ]
      },
      'bin': {
        'name': 'hello-world',
        'comment': 'the name of the executable to generate'
      }
    }
So where is the problem ?

And you have the advantage, that other tools can use the complete file including the comment. In TOML you need an extra parser to grab the comment.

Re:Cargo, Rust's Package Manager by simias on Tuesday June 24, 2014 @06:06AM (#7936904)
I don't really care what format the cargo files use (that's just an inconsequential bikeshed as far as I'm concerned) but in your example "comment" is really not a comment. I would expect to be able to put free-form comments anywhere I want and have them thrown away by the parser.

Your solution works fine for docstrings, but comments and docstrings are not the same thing (although many languages that don't support docstrings in the syntax hack them together using comments, admittedly).

But beyond that, what's the argument for switching to json? Is there some kind of intercompatibility with npm/Node.js to be gained?

Re:Cargo, Rust's Package Manager by wtetzner on Tuesday June 24, 2014 @06:56AM (#7937016)
Comments aren't just used to put notes in the file. They're also used to comment out code.

Also, having to quote everything makes writing JSON by hand a pain. Why would you want to use it over a nicer format?

Re:Cargo, Rust's Package Manager by mercurial on Wednesday June 25, 2014 @12:53AM (#7942306)
It's sad to see that the guidelines about downvoting are clearly not respected.
Re:Cargo, Rust's Package Manager by bryanlarsen on Tuesday June 24, 2014 @10:53AM (#7938076)
YAML is a serialization format, not a configuration format.
Re:Cargo, Rust's Package Manager by stormbrew on Tuesday June 24, 2014 @02:26PM (#7939479)
It's really a configuration format that mistook itself for a serialization format.

What I wouldn't do for a cut-down YAML standard with most of the serialization crap cut out.