It is a big deal, JSON is supposed to be a frozen and unchanging format. And if we change it, anything that accepts it is automatically broken, which is a very...
1851
Tatu Saloranta
cowtowncoder
Jul 10, 2012 7:57 pm
On Tue, Jul 10, 2012 at 12:55 PM, Borislav Iordanov ... For some perspective on this, one could consider fate of XML 1.1, which actually does not have this...
1852
Jos de Jong
wjosdejong
Jul 10, 2012 8:00 pm
Your propositions looks very clear. However, I think it is a bad idea to change JSON. JSON definitely has weak points (such as no predefined structure for a...
1853
Jos de Jong
wjosdejong
Jul 10, 2012 8:04 pm
If you want a standard that is even easier to read for humans than JSON, then just use YAML <http://www.yaml.org/> or something like that (JSON is a subset of...
1854
Ben Atkin
vote_zaphod_...
Jul 10, 2012 8:09 pm
The standard is respected in most places. Try adding comments and then using a common JSON parser (like the one in Firefox or Chrome) and you'll see an error....
1855
Andrew Faulds
ajfweb@...
Jul 10, 2012 8:12 pm
It's all well and good creating eon, but nothing stops you doing this: { "$comment: by the way, don't use values < 2" "thing": 2, } ... -- Andrew Faulds (AJF) ...
1856
Andrew Faulds
ajfweb@...
Jul 10, 2012 8:13 pm
er, that was horribly malformed, but you get what I mean. ... -- Andrew Faulds (AJF) http://ajf.me/ [Non-text portions of this message have been removed]...
1857
Ben Atkin
vote_zaphod_...
Jul 10, 2012 8:15 pm
Outside of special interpretation of strings, there's only one change I can think of that JSON could make that many existing parsers would be forward...
1858
Andrew Faulds
ajfweb@...
Jul 10, 2012 8:18 pm
Oh, that isn't special interpretation, that's just using keys your app doesn't check. ... -- Andrew Faulds (AJF) http://ajf.me/ [Non-text portions of this...
1859
Ben Atkin
vote_zaphod_...
Jul 10, 2012 8:24 pm
Here's what I mean: according to the JSON spec and in Ruby 1.8, if you parse {"j":true,"s":true,"o":true,"n"} and throw out the input but keep the result,...
1860
Gregg Irwin
greggirwin143
Jul 10, 2012 8:27 pm
Thanks for taking the time to write your propositions and post here. I agree with others here, Jos making the same points I would (though I don't care for YAML...
1861
John Cowan
johnwcowan
Jul 10, 2012 8:43 pm
... You don't say so, but your Proposition II (optional quotes on keys) breaks EcmaScript 3 compatibility, because all reserved words in that standard are...
1862
Ben Atkin
vote_zaphod_...
Jul 10, 2012 8:43 pm
Excellent call on removing comments from your JSON parser, despite liking them. Part of my project with Eon is getting wide language support, so I'm happy to...
1863
Ben Atkin
vote_zaphod_...
Jul 10, 2012 8:46 pm
The author didn't specify what keys could have their quotes omitted. If I were to design that feature I would probably limit it to a common subset of supported...
1864
Andrew Faulds
ajfweb@...
Jul 10, 2012 8:47 pm
I don't think the introduction of comments alone will get your project any adoption, even though it makes it easier to implement. ... -- Andrew Faulds (AJF) ...
1865
Ben Atkin
vote_zaphod_...
Jul 10, 2012 8:51 pm
It doesn't just make it easy to implement; it also makes it easier to grok. So I think it has a shot at getting some usage. FWIW I'm not trying to get people...
1866
Andrew Faulds
ajfweb@...
Jul 10, 2012 8:53 pm
For configs I ask, why not just use Microsoft's Initialisation file format (.ini)? It's limited, sure, you only have 1 level of depth, but it's fine for most...
1867
douglascrockford
douglascrock...
Jul 10, 2012 8:53 pm
... You don't need a new standard. Just pipe JSMin in front of your JSON parser....
1868
Ben Atkin
vote_zaphod_...
Jul 10, 2012 8:55 pm
I often go deeper than that. Also the JSON format is very clear. It's clearer than simpler formats like CSV and INI in how it represents strings....
1869
Andrew Faulds
ajfweb@...
Jul 10, 2012 8:56 pm
Wait, wouldn't JSMin leave in unquoted key names? ... -- Andrew Faulds (AJF) http://ajf.me/ [Non-text portions of this message have been removed]...
1870
John Cowan
johnwcowan
Jul 10, 2012 9:27 pm
... Actually, multiple levels are permitted by convention. If the name inside the brackets has backslashes in it, it is interpreted as a multi-level name. -- ...
1871
Andrew Faulds
ajfweb@...
Jul 10, 2012 9:32 pm
I meant that you can't really nest things (although theoretically you could put an INI file as a string, but it's unwieldy) ... -- Andrew Faulds (AJF) ...
1872
Ben Atkin
vote_zaphod_...
Jul 10, 2012 10:12 pm
I agree filtering makes sense, but why run it through a full-blown filter when all I want is to support comments? I think this is a nice efficient and simple...
1873
Andrew Faulds
ajfweb@...
Jul 10, 2012 10:14 pm
JSMin isn't a full-blown filter, it relies on valid JS/JSON being passed in. pass in "b + ++a" and you'll get "b+++a" out. ... -- Andrew Faulds (AJF) ...
1874
Ben Atkin
vote_zaphod_...
Jul 10, 2012 10:18 pm
Thanks for pointing that out. That reminds me - another thing I want is to be able to automatically change something in an eon file without stripping out...
1875
Andrew Faulds
ajfweb@...
Jul 10, 2012 10:30 pm
You don't want JSON, then. JSON isn't designed to update an existing file, it deserialises and serialises. ... -- Andrew Faulds (AJF) http://ajf.me/ [Non-text...
1876
Ben Atkin
vote_zaphod_...
Jul 10, 2012 10:39 pm
Which format should I use, then? XML? http://www.coderanch.com/t/128908/XML/Preserve-comments-XSL But I like JSON! Also these configs are going to get turned...
1877
Andrew Faulds
ajfweb@...
Jul 10, 2012 10:41 pm
Don't complain that JSON isn't what you want it to be. There are plenty of alternative formats, use one of them, instead. ... -- Andrew Faulds (AJF) ...
1878
Ben Atkin
vote_zaphod_...
Jul 10, 2012 10:42 pm
Don't tell me what to do....
1879
Andrew Faulds
ajfweb@...
Jul 10, 2012 11:01 pm
I'm not telling you what to do, I'm just saying that whining that a fixed standard, which is designed for something different to what you want, does not do...