4 ms·
I think it's time for a JSON version 2. a) no mandatory quotes for dicts keys b) date and time intervals in iso 8601 format. c) optional type-specifiers
by silvestrov 7y ago
I think it's time for a JSON version 2.
a) no mandatory quotes for dicts keys
b) date and time intervals in iso 8601 format.
c) optional type-specifiers for strings, so we can add e.g. ip4 and ip6 addresses. Eg. { remote: "127.0.0.1"#ip4 }
e.g.
{ guests: 42, arrival: @2020-02-17T17:22:45+00:00, duration: @@13:47:30 }
- alexis_fr 7y agoAnd comments.
- jnwatson 7y agoThere’s a corollary in there to Greenspun’s tenth. Any sufficiently complicated serialization technology contains an ad-hoc, informally-specified, bug-ridden, slow implementation of half of ASN.1.
- vbezhenar 7y agoName "JSON" would be weird, because it wouldn't be JavaScript-compatible syntax anymore. I know, that few people would agree with me, but I would propose `new Date(2020, 2, 17, 17, 22, 45)` syntax, even if nobody uses `eval` to parse JSON, keeping historical heritage is important. And if you need timezone, something like `Date.parse("2011-10-10T14:48:00.000+09:00")` could be used. Now it's not a real constructor or function calls, it's just a syntax, but it's still compatible with JavaScript.