JSON and alternatives and an extension proposal
The genius of JSON is that it's so simple. It can even be parsed with a single regex, albeit a rather complex Perl-specific one). In a few years, it has practically taken over the world, especially since at the time people yearned for something simpler and saner than XML.
The problem with JSON is that it's too simple. It lacks features. Yesterday while working on an API that is supposed to return PNG images, I was again reminded by the fact that JSON does not handle binary data. Let's see what else JSON does not support: Inf & NaN, differentiating normal hashes vs objects, Regexps, circular references, ... (some people might want to add comments and trailing commas to that list).
Additional syntax include:
1) RegExp literals:
3) for encoding binary data, something like
new Buffer("\x00abc\xff") which converts a UTF-8 encoded string into binary data. Or perhaps a helper function like
bin() to make it cross-platform (HTML5 browsers use Uint8Array).
4) for circular references, allow simple assignment syntax.