Skip to content

Three Laws of JSON5

Jordan Tucker edited this page Dec 11, 2015 · 3 revisions

In the spirit of Isaac Asimov's Three Laws of Robotics, here are the Three Laws of JSON5.

Each law takes precedence over the ones following it.

  1. JSON5 must be a superset of JSON, i.e. be backward compatible with the JSON syntax, API, and implementations by V8, SpiderMonkey, and Chakra.
  2. JSON5 must be a subset of ECMAScript 5, i.e. can be parsed as ES5. This also means introducing no new data types. This does not mean that JSON5 should implement every ES5 feature it can.
  3. JSON5 must aim to make writing and reading data documents easier by including features like comments, unquoted property names, multiple line strings, trailing commas, etc.