News for hackers. Stuff that matters.
Re:JSON5 is a proposed extension to JSON by derefr on Saturday March 01, 2014 @04:56PM (#7326320)
If web browsers had native YAML parsing, we probably wouldn't need JSON5. Web browsers aren't going to get native YAML parsing.
Re:JSON5 is a proposed extension to JSON by stormbrew on Saturday March 01, 2014 @05:11PM (#7326377)
They probably aren't going to get native json5 parsing either (except in the sense that you can do something stupid like eval it). That said, I don't think there's any particular need for yaml in the browser. Browser code is usually dealing with machine-generated data, where even normal json is just fine.
Re:JSON5 is a proposed extension to JSON by derefr on Saturday March 01, 2014 @05:14PM (#7326388)
Rich client-side apps need configuration files too.
Re:JSON5 is a proposed extension to JSON by yeukhon on Saturday March 01, 2014 @05:23PM (#7326413)
If this was merely a configuration (say for node.js) which sits on the server, then you probably just import a npm to read yaml (I don't write node.js so I don't know if using .yaml is feasible as node.js config file or not). So the use case is limited.

I used to work on a project which users could edit a configuration file through a web editor and we chose YAML because writing JSON by hand is painful (I hate the comma error!). But we processed this YAML file for the user on the server side, so having a native YAML parser in browser and Javascript wouldn't really help me at all.

Re:JSON5 is a proposed extension to JSON by derefr on Saturday March 01, 2014 @06:18PM (#7326635)
No, I'm talking about configuration files that get interpreted by code that is executing within the browser.

For example, a configuration-data file format for specifying a "brush" in a JS-client paint program. That'd obviously be a schema on top of JSON, right? Well, now you've got all of JSON's inherent limitations.

Re:JSON5 is a proposed extension to JSON by j03w on Sunday March 02, 2014 @01:55AM (#7328048)
Then you don't need JSON, all you need is the plain old JS object.
Re:JSON5 is a proposed extension to JSON by derefr on Sunday March 02, 2014 @04:01PM (#7330741)
You're thinking of the live representation of the "model" of a brush in the program. I'm talking about the "definition" of a brush, from which the program loads that model. Another example would be, say, a "level" in an HTML5 game. These things ship alongside the game as blobs of data. Those blobs need a format that the browser can parse. Currently, JSON is that format, and it's inadequate for that.
Re:JSON5 is a proposed extension to JSON by novaleaf on Sunday March 02, 2014 @10:30PM (#7331879)
don't need native json5 parsing. just load the lib up. the problem is yaml is there isn't any safe+browser version that I know of.
Re:JSON5 is a proposed extension to JSON by drdaeman on Saturday March 01, 2014 @05:09PM (#7326373)
> Web browsers aren't going to get native YAML parsing.

Because of what?