Marshaling Unmarshaling as a Compilation Interpretation Process
Résumé
Marshaling is the process through which structured values are serialized into a stream of bytes; unmarshaling converts this stream of bytes back to structured values. Most often, for a given data structure, the marshaler and the unmarshaler are tightly related pieces of code that are synthesized conjunctly. This paper proposes a new point of view: the unmarshaler is considered as a byte-code interpreter evaluating a stream of bytes considered as a program i.e., a sequence of commands interspersed with quoted raw data. This program is an expression of the marshaling language. From that point of view, the marshaler logically appears as a compiler translating values into expressions of the marshaling language.