News for hackers. Stuff that matters.
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.