Question about Val serialization

Christian Kreibich christian at whoop.org
Fri Jul 9 11:34:05 PDT 2004


Master Robin,

I have a question about the serialization of vals (when serializing an
event call, for example). A bit of background: yesterday looked at
support for sending/receiving records in Broccoli. I got receiving
records working fairly quickly, and noticed that the serialization
protocol currently insists on sending the full serialized type of the
val it is sending (RemoteSerializer.cc, around 126):

  loop_over_list(*args, i) (*args)[i]->Serialize(this, true, info);
                                                       ^^^^
calling

  bool Val::Serialize(Serializer* s,
                      bool save_type,
                      const SerialInfo& info) const;

My question is, why is it necessary to send the full type details along
with the val, and not just an identifier of the type? It seems to me
that since types aren't really first-class data structures in the Bro
language (ie. no reflection etc) the remote Bro won't be able to do much
with the val if the script doesn't know the type already anyway?

I know the serialization caching mechanism you're using to stop sending
types repeatedly, but why is it *ever* necessary to send a type? Clearly
you had a reason in mind ...

I'm of course asking because ideally in Broccoli I'd like to be able to
send a record val just by saying what type of record it is and then just
send the list of values stored in the record. 

So, is there any chance that sending the type along will be optional in
the new serialization protocol?

Thanks,
Christian.
-- 
________________________________________________________________________
                                          http://www.cl.cam.ac.uk/~cpk25
                                                    http://www.whoop.org





More information about the Bro mailing list