March 31, 2013
On Saturday, 30 March 2013 at 20:02:48 UTC, Jesse Phillips wrote:
> 3) Serialization is done by message (struct) and not by primitives

PB does serialize by primitives and Archive has archiveStruct method which is called to serialize struct, I believe. At first sight orange serializes using built-in grammar (in EXI terms), and since PB uses schema-informed grammar, you have to provide schema to the archiver: either keep it in the archiver or store globally.
March 31, 2013
On 2013-03-31 12:40, Kagamin wrote:

> http://dpaste.dzfl.pl/0f7d8219

So instead Serializer gets a huge API?

-- 
/Jacob Carlborg
March 31, 2013
On 2013-03-31 13:23, Kagamin wrote:

> PB does serialize by primitives and Archive has archiveStruct method
> which is called to serialize struct, I believe. At first sight orange
> serializes using built-in grammar (in EXI terms), and since PB uses
> schema-informed grammar, you have to provide schema to the archiver:
> either keep it in the archiver or store globally.

The actual struct is never passed to the archive in Orange. It's basically lets the archive know, "the next primitives belong to a struct".

-- 
/Jacob Carlborg
March 31, 2013
On Sunday, 31 March 2013 at 17:33:28 UTC, Jacob Carlborg wrote:
> On 2013-03-31 12:40, Kagamin wrote:
>
>> http://dpaste.dzfl.pl/0f7d8219
>
> So instead Serializer gets a huge API?

Are a lot of serializers expected to be written? Archives are.
March 31, 2013
On Sunday, 31 March 2013 at 17:36:12 UTC, Jacob Carlborg wrote:
> The actual struct is never passed to the archive in Orange. It's basically lets the archive know, "the next primitives belong to a struct".

Knowing the struct type name one may select the matching schema. In the case of PB the schema collection is just int[string][string] - maps type names to field maps.
March 31, 2013
On Sunday, 31 March 2013 at 17:33:28 UTC, Jacob Carlborg wrote:
> On 2013-03-31 12:40, Kagamin wrote:
>
>> http://dpaste.dzfl.pl/0f7d8219
>
> So instead Serializer gets a huge API?

The point is to have Serializer as an encapsulation point, not archiver. API can remain the same, it's just calls to the archiver are to be routed through Serializer's virtual methods, not archiver's.
March 31, 2013
On Sunday, 31 March 2013 at 17:33:28 UTC, Jacob Carlborg wrote:
> On 2013-03-31 12:40, Kagamin wrote:
>
>> http://dpaste.dzfl.pl/0f7d8219
>
> So instead Serializer gets a huge API?

As an alternative routing can be handled in the archiver by a template mixin, which defines virtual methods and routes them to a templated method written by the implementer. So it will be the implementer's choice whether to use mixin helper or implement methods manually.
March 31, 2013
Manual implementation is probably better for PB.
March 31, 2013
On 2013-03-31 21:02, Kagamin wrote:

> Are a lot of serializers expected to be written? Archives are.

Hmm, maybe it could work.

-- 
/Jacob Carlborg
March 31, 2013
On 2013-03-31 21:06, Kagamin wrote:

> Knowing the struct type name one may select the matching schema. In the
> case of PB the schema collection is just int[string][string] - maps type
> names to field maps.

Ok. I'm not familiar with Protocol Buffers.

-- 
/Jacob Carlborg