News for hackers. Stuff that matters.
Re:Hjson, the Human JSON by david-given on Thursday April 14, 2016 @01:05PM (#11498465)
If trailing commas and quotation marks are optional, then does this:

    foo: 4,
...produce the value 4, "4", or "4,"?
Re:Hjson, the Human JSON by alanh on Thursday April 14, 2016 @04:46PM (#11500216)
Excellent example.

While I have been hoping for "JSON plus comments" to be a real and common thing for quite a while now, one of the strengths of JSON is right there on json.org. See it? A set of five simple syntax diagrams that entirely and virtually unambiguously define the json syntax.

It’s tough to know when to stop when simplifying a syntax. (For an extreme example, see Stylus, which was like Sass but so extreme that mixins and properties became ambiguous for each other.) I, too, would like to see the return of quotes for string values, for increased clarity.

Re:Hjson, the Human JSON by PuerkitoBio on Thursday April 14, 2016 @01:41PM (#11498832)
From the docs:

  > When you omit quotes the string ends at the newline.
  > Preceding and trailing whitespace is ignored as are escapes.
  >
  > A value that is a number, true, false or null in JSON is 
  > parsed as a value. E.g. 3 is a valid number while 3 times is 
  > a string.
(edit: formatting)
Re:Hjson, the Human JSON by lumpypua on Thursday April 14, 2016 @04:02PM (#11499886)
Right but the point is that you had to consult the docs. It's a problem of ambiguity on the part of the format.
Re:Hjson, the Human JSON by PuerkitoBio on Thursday April 14, 2016 @07:57PM (#11501157)
It is ambiguous only if you think it can be a completely useless format. If you decide to use it, chances are you considered it useful, and the only useful way this can parse is as a number, otherwise it would't be able to represent numbers, booleans and null. I'd say it parses pretty much as expected, and as such, contrary to other comments, you don't have to go back to the docs every so often.
Re:Hjson, the Human JSON by chris-at on Thursday April 14, 2016 @04:34PM (#11500123)
Of course you have to get the information from somewhere the first time you learn something. What's the problem with that?
Re:Hjson, the Human JSON by dandelany on Thursday April 14, 2016 @05:10PM (#11500380)
The problem is that this is supposed to be a more-easily-readable form of JSON, but it requires consulting the docs to understand the meaning of something which is completely unambiguous in regular JSON.
Re:Hjson, the Human JSON by ssalazar on Thursday April 14, 2016 @07:47PM (#11501125)
> Of course you have to get the information from somewhere the first time you learn something. What's the problem with that?

The first time, and the second time if you haven't looked at it in a month, and a third time a month after that. And so on.

Re:Hjson, the Human JSON by bobbyi_settv on Thursday April 14, 2016 @05:25PM (#11500464)
So if you put "true" (without quotes) as a value, you get a boolean, but if you put "True", you get a string?
Re:Hjson, the Human JSON by cortesoft on Thursday April 14, 2016 @07:07PM (#11500970)
So would that be "4," that you end up with, then?