Joe,<div><br></div><div>I know you had another email related to this, but I'm wondering why you couldn't use BERT and on the Erlang side, base64 encode it (so Jquery AJAX can work with it), then base64 decode it in the JavaScript and use BERT-JS (<a href="https://github.com/rustyio/BERT-JS">https://github.com/rustyio/BERT-JS</a>) and the same thing going the other way. This should ensure that things never change between serialization/deserialization.</div>
<div><br></div><div>Just a thought....</div><div><br></div><div>Andrew<br><br><div class="gmail_quote">On Fri, Nov 25, 2011 at 10:19 AM, Joe Armstrong <span dir="ltr"><<a href="mailto:erlang@gmail.com">erlang@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br><br><div class="gmail_quote">On Fri, Nov 25, 2011 at 6:10 PM, Max Lapshin <span dir="ltr"><<a href="mailto:max.lapshin@gmail.com" target="_blank">max.lapshin@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Joe, so do you have any problems with it?<br></blockquote><div><br></div><div>Yes - if you as I pointed out the encode and decode in</div><div>mochijson2 are not inverses so</div><div><br></div><div> X = decode(encode(X)) is not always true</div>
<div><br></div><div>bignums can get clobbered - floats might change precision</div><div><br></div><div>the behaviour or duplicated tags is undefined.</div><div><br></div><div>If I say X = {a:1, b:2, a:2} then encode and decode it then ask what is</div>
<div>X.a is it 1 or 2 ? who knows</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
If no, than don't be afraid. JSON is a really simple thing.<br>
</blockquote></div><br><div>It looks simple - anyway it would be much better to send</div><div>binary encodings which need no parsing, rather that things that</div><div>need to be parsed.</div><span class="HOEnZb"><font color="#888888"><div>
<br></div><div>/Joe</div>
<div><br></div>
</font></span><br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>