<div dir="ltr">In browser JSON.serialize is the usual way to serialize JSON values.<div>The problem is that on D side if one does deserialization of an object or struct. If the types inside the JSON don't match exactly then vibe freaks out.</div><div><br></div><div>Another problem with most D JSON implementations is that they don't support proper JSON, e.g. outputting nan as though it was a valid value etc... browsers don't like that stuff.</div><div><br></div><div>For me the best D JSON implementation at the moment is actually jsvar by Adam and its not even a JSON parser, it just has that as a needed feature. It feels slow though I haven't benchmarked, but if I run it over a couple of Gigs of data(Paged by 1000) it takes a long while.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 15, 2015 at 3:42 AM, Marco Leise via Digitalmars-d-announce <span dir="ltr"><<a href="mailto:digitalmars-d-announce@puremagic.com" target="_blank">digitalmars-d-announce@puremagic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Am Wed, 14 Oct 2015 10:22:37 +0200<br>
schrieb Rory McGuire via Digitalmars-d-announce<br>
<<a href="mailto:digitalmars-d-announce@puremagic.com">digitalmars-d-announce@puremagic.com</a>>:<br>
<span class=""><br>
> Does this version handle real world JSON?<br>
><br>
> I've keep getting problems with vibe and JSON because web browsers will<br>
> automatically make a "1" into a 1 which then causes exceptions in vibe.<br>
><br>
> Does yours do lossless conversions automatically?<br>
<br>
</span>No I don't read numbers as strings. Could the client<br>
JavaScript be fixed? I fail to see why the conversion would<br>
happen automatically when the code could explicitly check for<br>
strings before doing math with the value "1". What do I miss?<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Marco<br>
<br>
</font></span></blockquote></div><br></div>