18. A computer storage medium having computer-executable instructions, which when executed perform actions, comprising: obtaining a grammar that defines a format for serializing an object, the grammar representing rules for serializing the object that preserve embedded objects and relationships in a serialized representation of the object, the grammar defining a header and a payload for serializing the object, the header including metadata of the grammar, the payload including an identifier of each descendent object of the object, the payload further including reference data for each reference, if any, included in the object, the reference data indicating relationships of the object, the reference data potentially referring to one or more of: an object type supported by a scripting environment in which the object resides, an object type supported by a host environment of the scripting environment, and a foreign object type that is defined outside of both the scripting environment and the host environment; and obtaining serialized data that has been generated using a version of the grammar; de-serialize the serialized data to create a de-serialized representation of the object based on a difference between a minor version of a serialization engine to serialize the object and a minor version of a de-serialization engine to de-serialize the object and a difference between a major version of the serialization engine to serialize the object and a major version of the de-serialization engine to de-serialize the object.
18. A computer storage medium having computer-executable instructions, which when executed perform actions, comprising: obtaining a grammar that defines a format for serializing an object, the grammar representing rules for serializing the object that preserve embedded objects and relationships in a serialized representation of the object, the grammar defining a header and a payload for serializing the object, the header including metadata of the grammar, the payload including an identifier of each descendent object of the object, the payload further including reference data for each reference, if any, included in the object, the reference data indicating relationships of the object, the reference data potentially referring to one or more of: an object type supported by a scripting environment in which the object resides, an object type supported by a host environment of the scripting environment, and a foreign object type that is defined outside of both the scripting environment and the host environment; and obtaining serialized data that has been generated using a version of the grammar; de-serialize the serialized data to create a de-serialized representation of the object based on a difference between a minor version of a serialization engine to serialize the object and a minor version of a de-serialization engine to de-serialize the object and a difference between a major version of the serialization engine to serialize the object and a major version of the de-serialization engine to de-serialize the object. 20. The computer storage medium of claim 18 , wherein obtaining the grammar comprises obtaining the grammar from the serialized data.