News for hackers. Stuff that matters.
Re:Show HN: JSON5 — modern JSON by aseemk on Sunday May 27, 2012 @10:54PM (#4031737)
Writing, or at least editing, JSON by hand seems unavoidable if you develop on Node, as modules' "manifests" are JSON files.

I also love to make tests data-driven where possible. JSON is the natural format for data on Node, and again, test cases are usually written by hand (before code exists to generate or validate them).

I'm not sure I understand your point about eval'ing. This parser doesn't use eval(), and it works in every modern browser.

Finally, I'm not advocating for arbitrary looseness. These additions conform directly to ES5's additions.

Re:Show HN: JSON5 — modern JSON by aurelianito on Monday May 28, 2012 @12:06AM (#4031880)
I believe you should do something like this:

  json.stringify({unquoted:'Some value', trailing_comma:true,})
instead of hand-writting JSON data in tests.
Re:Show HN: JSON5 — modern JSON by ZenPsycho on Monday May 28, 2012 @12:34AM (#4031944)
I have implemented a javascript eval into my text editor. When I select text, and call the command, it passes it off to a node.JS engine and replaces the selection with the return result. In this way I can write a JSON.stringify([anyvalid javascript],null, [indentation]); and instantly get perfect JSON. This is much less troublesome than trying to make a new slightly incompatible format.