[erlang-questions] No JSON/MAPS interoperability in 17.0?
Richard A. O'Keefe
ok@REDACTED
Wed Mar 12 00:31:43 CET 2014
On 10/03/2014, at 8:06 AM, Carsten Bormann wrote:
> On 09 Mar 2014, at 17:05, Anthony Ramine <n.oxyde@REDACTED> wrote:
>
>> What about the utter lack of proper specifications around JSON?
>
> JSON is fully specified in RFC 7159.
Speaking as someone who has built a JSON library,
NO, JSON is *NOT* fully specified.
Anywhere.
RFC 7159 is ambiguous on a number of key points, and
existing parsers differ on those points. To give just
one example, if you are given
{"foo": 1, "foo": 2}
should this be (a) an error, (b) equivalent to {"foo": 1},
(c) equivalent to {"foo": 2}, or (d) something else?
I used to believe in Postel's principle, but after trying
to work with HTML and JSON, I believe that there are
cases where it is better for the community as a whole if
you are strict in what you accept. See
http://programmingisterrible.com/post/42215715657/postels-principle-is-a-bad-idea
But also see
http://www.cookcomputing.com/blog/archives/000551.html
where we learn what Postel actually meant:
- be converative: only generate a core subset of what
the protocol allows
- be liberal: accept everything *that the protocol allows*.
When people accept stuff outside what the protocol explicitly
allows, they cannot appeal to Postel.
In any case, Erlang's problem is not that it does not support
JSON but that there are so many JSON libraries out there that
it is difficult to know which one to pick.
More information about the erlang-questions
mailing list