std.data.json formal review

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Mon Aug 17 15:34:43 PDT 2015


On 8/17/15 2:51 PM, deadalnix wrote:
>  From the compiler perspective, the tag is much nicer. Compiler can use
> jump table for instance.

The pointer is a more direct conduit to a jump table.

> It is not a good solution for Variant (which needs to be able to
> represent arbitrary types) but if the amount of types is finite, tag is
> almost always a win.
> In the case of JSON, using a tag and packing trick, it is possible to
> pack everything in a 2 pointers sized struct without much trouble.

Point taken. Question is if this is worth it.


Andrei


More information about the Digitalmars-d mailing list