It's a pull parser? Hmm... how reordered fields are supposed to be handled? When the archiver is requested for a field, it will probably need to look ahead for the field in the entire message. Also arrays can be discontinuous both in xml and in pb. Also if the archiver is requested for a missing field, it may be a bad idea to return typeof(return).init as it will overwrite the default value for the field in the structure. Though, this may be a minor issue: field usually is missing because it's obsolete, but the serializer will spend time requesting missing fields.

As a schema-informed serialization, PB works better with specialized code, so it's better to provide a means for specialized serialization, where components will be tightly coupled, and the archiver will have full access to the serialized type and will be able to infer schema. Isn't serialization simpler when you have access to the type?

Reply via email to