Serialization for D. Comments, please!

BCS none at anon.com
Sun Jun 14 14:04:25 PDT 2009


Hello grauzone,

> BCS wrote:
> 
>>> introduce annotations into the language.
>>> 
>> NO, not an option.
>> 
> What, why? Sure, this is not a realistic option.
> 

D1 is fixed, and D2 will be in the next few months. I'm not going to even 
think of targeting D3 at this point. I'm writing this to be used, not as 
a theoretical construct.

>> Well, I can switch the default but, in my experience, most of the
>> time repetition doesn't matter. I also dissagree on the "relatively
>> useless
>> 
> Oh really?
> 

I haven't used a graph data structure in some time. Most of them have been 
trees. And the cases I can think of, the repeated reference bit has been 
central the the structure so the chances of getting it wrong (or of missing 
it under test) are about nil.

>> optimization" bit, it adds some not exactly trivial overhead in about
>> 3 or 4 different places.
>> 
> Maybe it costs a hash table lookup, but apart from that, you're saving
> space and time for marshaling additional instances. Of course, this is
> different with structs. But structs are value types.
> 

which side are you arguing there? 

OTOH pointers to struct are not value types...

>> interfaces are not supported either.
>> 
> But supporting interfaces would be very simple.
> 

It wouldn't be hard in the current form (you would add a mixin to the interface 
as well) but the non-mixin, outside in approach would have all sorts of interesting 
issues like how to get the correct sterilizer function.




More information about the Digitalmars-d-announce mailing list