Wow, the YAML-Core list is aflame with a conquest to get JSON to become a subset of YAML. The differences have historically been very, very minor. But tough to solve, given the aims of both languages. Oren Ben-Kiki suddenly piped up this week with some ideas and the TrinitY have been bouncing ideas around since.
Basically, the differences have been:
Colon cramping:
In YAML hashes, the colon must be followed by a space:
{key: value}
In JSON hashes, you can butt the key and value right up to the colon:
{"key":"value"}
This seems minor until you witness how it conflicts with YAML’s timestamp format. (What is {10:20}?)
C-style comments: /* */
Were removed from JSON.
Single-quoted strings had different escaping rules between the two.
Such strings were removed from JSON.
The final answer is still being primed, but YAML’s definitely going to budge on this colon affair, folks! I’m sure you’ll be hearing once we’ve got it all ready for you.
Oh, and while scouting around in the JSON draft proposal, this little bit of regexp security caught my eye. Can’t hurt I guess.
var my_JSON_object = !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(
text.replace(/"(\\.|[^"\\])*"/g, ''))) &&
eval('(' + text + ')');