Working on new binary serialization module for phobos (hopefully)

Sean Campbell via Digitalmars-d digitalmars-d at puremagic.com
Mon Jun 1 18:23:15 PDT 2015


On Monday, 1 June 2015 at 15:11:54 UTC, Atila Neves wrote:
> On Monday, 1 June 2015 at 12:52:45 UTC, Sean Campbell wrote:
>> I've been working on a new serialization module for Phobos and 
>> its only reliant on 4 Phobos modules
>> it is available at 
>> https://github.com/sycam0inc/phobos/blob/master/std/experimental/serialization.d
>>
>> I would like some feedback on it
>
> I'm biased since I wrote this: 
> https://github.com/atilaneves/cerealed.
>
> At a glance, I don't like at all that types have to opt-in to 
> be serialised. Why the limitation?
>
I changed this earlier but forgot to push changes from my laptop 
if you check it now it will be fixed
> You don't need reverseOf, just use std.range.retro.
>
thank you, I have a bad habit of writing already existing 
algorithms
> Cerealed has more features than this as well. I'd struggle to 
> write code as short as I did when using it to implement 
> networking protocols. I also only encoded bytes as big-endian 
> since binary serialization is usually followed by sending those 
> bytes over the wire. Given you check the endianess of the 
> system here, how would that work?
>
I don't know what you mean bytes by themselves don't have an 
endianness, do they?
I thought is was only anything that was larger than a byte had 
endianness
> I liked the union trick, I wonder why I didn't think of that. 
> Well, there's the endianness problem I guess.
>
> Atila



More information about the Digitalmars-d mailing list