std.jgrandson

Sönke Ludwig via Digitalmars-d digitalmars-d at puremagic.com
Sun Aug 3 02:40:04 PDT 2014


Am 03.08.2014 10:25, schrieb ponce:
>>
>> API looks great but I'd like to see some simple serialize/deserialize
>> functions as in vibed:
>> http://vibed.org/api/vibe.data.json/deserializeJson
>> http://vibed.org/api/vibe.data.json/serializeToJson
>>
>> vibe uses UDAs to customize the serialization output. That's actually
>> not json specific and therefore shouldn't be part of this module. But a
>> simple deserializeJson which simply fills in all fields of a struct
>> given a TokenStream is very useful and can be done without allocations
>> (so it's much faster than going through the DOM).
>
> That's what https://github.com/Orvid/JSONSerialization does.
> Also msgpack-d https://github.com/msgpack/msgpack-d whose defaults need
> no UDAs
>
> That makes the typical use case very fast to write.

The default mode for vibe.data.serialization also doesn't need any UDAs, 
but it's still often useful to be able to make customizations.


More information about the Digitalmars-d mailing list