RFC: std.json sucessor

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Wed Aug 27 16:51:51 PDT 2014


On 8/26/2014 12:24 AM, Don wrote:
> On Monday, 25 August 2014 at 23:29:21 UTC, Walter Bright wrote:
>> On 8/25/2014 4:15 PM, "Ola Fosheim Grøstad"
>> <ola.fosheim.grostad+dlang at gmail.com>" wrote:
>>> On Monday, 25 August 2014 at 21:24:11 UTC, Walter Bright wrote:
>>>> I didn't know that. But recall I did implement it in DMC++, and it turned out
>>>> to simply not be useful. I'd be surprised if the new C++ support for it does
>>>> anything worthwhile.
>>>
>>> Well, one should initialize with signaling NaN. Then you get an exception if you
>>> try to compute using uninitialized values.
>>
>>
>> That's the theory. The practice doesn't work out so well.
>
> To be more concrete:
>
> Processors from AMD have signalling NaN behaviour which is different from
> processors from Intel.
>
> And the situation is worst on most other architectures. It's a lost cause, I think.

The other issues were just when the snan => qnan conversion took place. This is 
quite unclear given the extensive constant folding, CTFE, etc., that D does.

It was also affected by how dmd generates code. Some code gen on floating point 
doesn't need the FPU, such as toggling the sign bit. But then what happens with 
snan => qnan?

The whole thing is an undefined, unmanageable mess.


More information about the Digitalmars-d mailing list