Why JSON5? (was: Hash style comments)

Mark S. Miller erights at google.com
Fri Aug 10 12:00:44 PDT 2012


On Wed, Aug 8, 2012 at 8:58 AM, Trans <transfire at gmail.com> wrote:
> [...] Now there is consideration of JSON5
> (https://github.com/aseemk/json5). JSON5
> adds support for comments, [...]


JSON:
pros: standard, language neutral, extremely widely adopted, supported
efficiently starting with ES5
cons: lack of comments. Need to quote property names

JSON5:
pros: superset of JSON, subset of ES5, comments, no need to quote property names
cons: JS specific (rather than language neutral), non-standard, needs
custom parser in JS for processing on JS

SES:
pros: superset of JSON, subset of ES5, includes virtually all of ES5,
including of course JSON5, supported efficiently starting with ES5
with no need for a custom parser, de facto standard, already some
adoption at scale (Google Sites, Google App Script)
cons: JS specific (rather than language neutral), not (yet) a de jure standard


As safe midpoints between JSON and full ES5, SES has clear advantages
over JSON5 and includes JSON5 as a subset. What advantages does JSON5
have over SES? Is there any use case better addressed by JSON5 than by
SES?

-- 
    Cheers,
    --MarkM


More information about the es-discuss mailing list