Orange - Free from D1/Tango

Steven Schveighoffer schveiguy at yahoo.com
Sun Feb 17 19:22:07 PST 2013


On Sun, 17 Feb 2013 22:08:26 -0500, deadalnix <deadalnix at gmail.com> wrote:

> On Sunday, 17 February 2013 at 22:13:21 UTC, Steven Schveighoffer wrote:
>> On Sun, 17 Feb 2013 16:18:05 -0500, Walter Bright  
>> <newshound2 at digitalmars.com> 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?
>>
>> I would think D's type system would be capable enough where a  
>> serialization library can tell whether a type can be serialized or not.
>>
>
> It isn't as it don't convey ownership. And hopefully as getting rid of  
> ownership is important for idioms involving immutability.

Right, but in that case, you may have a common reference serialized  
several times.  Not necessarily the end of the world.

Perhaps what we need is two things:

1. A UDA that indicates "this type is certified correct for serialization"
2. A flag to serializer somehow that indicates "only serialize types that  
are certified correct for serialization, and pure value types"

I would hate to (and have hated to) mark serializable types when it is a  
trivial type, just because it's used inside a serializable type.

-Steve


More information about the Digitalmars-d mailing list