Request for review - std.serialization (orange)

Jacob Carlborg doob at me.com
Mon Jun 17 06:47:59 PDT 2013


On 2013-06-17 15:31, Francois Chabot wrote:

> I think that's kinda the sticking point with Orange for me. Integrating
> it in my current project implied bringing in a huge amount of code when
> my needs are super-straightforward.

Why is that a problem?

> I actually ended up writing myself a super-light range-based serializer
> that'll handle any combination of struct/Array/AA thrown at it. (for
> reference:
> https://github.com/Chabsf/flyb/blob/SerializableHistory/serialize.d ).
> It also does not copy data around, and instead just casts the data as
> arrays of bytes. It's under 300 lines of D code and does everything I
> need from Orange, and does it very fast. Orange is just so very overkill
> for my needs.

It's a lot easier to create a serializer which doesn't handle the full 
set of D. When you start to bring in reference types, pointers, arrays 
and slices it's start to get more complicated.

> My point is that serializing POD-based structures in D is so simple that
> using a one-size-fit-all serializer made to handle absolutely everything
> feels very wasteful.

You don't have to use it.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list