[erlang-questions] No JSON/MAPS interoperability in 17.0?
Paul Davis
paul.joseph.davis@REDACTED
Mon Mar 17 07:44:21 CET 2014
For extra nerdery on round-tripping floats one of the (historically)
oft-requested enhancements for Jiffy was to print 1.1 as "1.1" instead
of "1.10000000000000008882000000000000" which is always cumbersome.
The standard Googling leads to dtoa.c which depends on processor
rounding modes amongst other things. Luckily a lot of this was yanked
from V8 into a usable library [1].
The rest of this conversation has wandered a bit too much for me to
spend much time following. The basics I'd say are that if you want a
fast value-based (DOM?) parser, use Jiffy. If you want a streaming
(SAX?) or pure-erlang parser, use jsx.
Alisdair and I have talked extensively about most minute details of
JSON parsing and our libraries are about as close as they're gonna get
in terms of API compatibility. If Erlang decides to choose one or the
other one of us is gonna be happy and the other will be sad and have
to rewrite a lot of code or not use the builtin. Though I'd point out
that the builtin won't actually be "standard" until 3-5 years from now
so its probably not a huge issue either way.
And just because I haven't heard from Alisdair recently I have to
point out that {[]} is still the One True Empty Object representation.
[{}] is just atrocious.
[1] https://code.google.com/p/double-conversion/
On Sun, Mar 16, 2014 at 10:00 PM, Richard A. O'Keefe <ok@REDACTED> wrote:
>
> On 16/03/2014, at 4:58 AM, Loïc Hoguin wrote:
>>
>> I'm not sure you can guarantee this if the encoding/decoding happens on different architectures, can you? Is a 64bit floating point number the same on Intel, AMD, ARM, GPUs, FPGAs and so on?
>
> There's an actively maintained standard.
> Apple have supported it on three different hardware platforms
> (M680x0, PowerPC, Intel). SPARC does it. HPPA and MIPS do it.
> Alpha does it. Even IBM mainframes, while still supporting
> their old format, offer IEEE-compliant arithmetic these days.
> Intel, AMD and ARM certainly support it.
>
> About the only machines you are likely to meet these days
> that _don't_ offer IEEE arithmetic are Unisys E-mode systems.
> (Well, there might be some VAXen somewhere I suppose.)
>
> As for FPGAs, they do whatever they are programmed to do.
> Some have been programmed to do IEEE arithmetic, some haven't.
>
> As for GPUs, they are why half-precision (16-bit) floats
> are in IEEE-754:2008. OpenCL says single-precision
> floats will be there, double precision might or might not,
> but they are expected to be IEEE-compliant.
>
> XDR mandated the use of IEEE formats. It's still around.
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
More information about the erlang-questions
mailing list