[erlang-questions] Best way to send JSON from erlang to the browser and back

Joe Armstrong erlang@REDACTED
Fri Nov 25 19:19:42 CET 2011

On Fri, Nov 25, 2011 at 6:10 PM, Max Lapshin <max.lapshin@REDACTED> wrote:

> Joe, so do you have any problems with it?

Yes - if you as I pointed out the encode and decode in
mochijson2 are not inverses so

    X = decode(encode(X)) is not always true

bignums can get clobbered - floats might change precision

the behaviour or duplicated tags is undefined.

If I say X = {a:1, b:2, a:2} then encode and decode it  then ask what is
X.a is it 1 or 2 ? who knows

> If no, than don't be afraid. JSON is a really simple thing.

It looks simple - anyway it would be much better to send
binary encodings which need no parsing, rather that things that
need to be parsed.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111125/19b3cfb3/attachment.htm>

More information about the erlang-questions mailing list