>>>>> "MS" == Melvin Smith <[EMAIL PROTECTED]> writes:
MS> At 04:38 PM 10/20/2003 -0400, Dan Sugalski wrote:
>> The encoding methods for freezing (and corresponding decoding methods for
>> thawing) may be overridden to provide an alternate serialization format.
>> The only requirement of the serialziation format is that it starts with a
>> minimally valid piece of XML that encodes the format and version of the
>> serialized format. The rest of the serialization format need not be XML.
>> This is done because the format and version of the serialized data are
>> required in the stream, and making it XML incoveniences nobody and makes
>> the XML folks happy. It's good enough, and not up for discussion.
MS> Does that mean all encodings will start with the "standard" markup header:
MS> <xml version="1.0"?>
MS> I'm not sure what minimally valid means, but I think this is considerable
MS> overhead.
how so? most serialized things (other than simple scalars) will generate much more data than that.
See below.
MS> Also, I don't think I like using freeze/thaw format for the MS> standard PBC format if we are embedding XML everywhere, which is MS> ok, but Leo had mentioned that we would use freeze/thaw for MS> loading classes. With XML in the picture I think it becomes too MS> bulky.
i don't he was referring to the current p5 freeze/thaw formats or code. he was just using freeze/thaw as the methods/calls to be made to do the work. the actual formats are undecided now AFAICT.
MS> If we are to use recursive serialization for classes then we'd end MS> up with fat bytecodes; every field and method would have the XML MS> header.
the xml header is only for the top level thing in the serialized tree. if it is nonstandard you have to mark the serialized string so you can call the matching thaw methods. each object in the serialized tree will have to support that method or some code has to be supplied to handle all the freeze/thaw calls made by the tree traverser code. so the xml header is just a way to mark which external class will be used for the freeze/thaw and it will always be called for each object in the tree. you can't mix/match different freeze/thaw techniques in one operation (yes, you could but then you do have to mark each node with its technique which is a lot of overhead and painful in other ways).
That answers my question of overhead with regards to XML headers. If there is a single header for defining the type of "stream" then the actual serialization can be dense enough.
I just needed clarification. :)
I think a grammar should be developed for this, since it should likely be implemented as a recursive parser.
-Melvin