Orange - Free from D1/Tango

Kapps opantm2+spam at gmail.com
Mon Feb 18 22:45:00 PST 2013


On Sunday, 17 February 2013 at 21:18:12 UTC, Walter Bright wrote:
> On 2/17/2013 12:51 PM, Jacob Carlborg wrote:
>> I just stripped out all D1 and Tango related code from Orange. 
>> D1/Tango is still
>> supported in the d1 branch. Hopefully this will make it easier 
>> to integrate into
>> Phobos.
>>
>> It also now supports UDA's for indicating a field/class/struct 
>> shouldn't be
>> serialized:
>>
>> class Foo
>> {
>>     @nonSerialized int a;
>> }
>>
>> @nonSerialized class Bar { }
>
> Hmm, shouldn't it be the other way around - marking the ones to 
> be serialized?

The vast majority of objects can be serialized without any 
problems. Those that can't usually aren't referenced in objects 
that are being serialized and you know what they are ahead of 
time. Forcing opt-in serialization would make every single 
library out there at the moment unusable with std.serialize. In a 
Component system for example, you won't know ahead of time what 
needs to be serialized, and a single object not being marked 
Serialized will completely prevent serialization.

That being said, personally I think serialization in Phobos has 
been delayed far too long for something that's so important to 
many programs. I'd be happy with either opt-in or opt-out, 
however I believe that there should be a way to customize how an 
object gets serialized, such as an onSerialize method or 
interface.


More information about the Digitalmars-d mailing list