Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
[RFC] Merge freeze/thaw with PBC #391
= Problems =
freeze/thaw and PBC are already inter-related:
freeze/thaw currently has issues related to subs. Specifically, the opcodes for the sub aren't frozen with the sub. The reason for this is that, when a sub is a constant in a PBC, the opcodes are stored elsewhere and the sub should be an index into the code segment.
Also, PBCs as they currently exist are more or less equivalent to frozen Eval PMCs (in function, not format).
The bottom line is we have 2 formats that are inter-dependant and have overlapping functionality.
= Proposed Solution =
Have freeze/thaw operate on a slight variant of PBC. That is, freeze returns a string containing the contents of a PBC file, and thaw would operate on such strings.
= Required Modifications to PBC =
Minimal. A new segment would need to be added for non-constant objects. For backwards compatibility, we could make the absence of this segment default to creating an Eval PMC.
= Required Modifications to freeze/thaw =
The IMAGE_IO object (or whatever we replace it with) would need to gain the concept of bytecode management. Sub PMCs would be responsible for adding their bytecode to the image on freeze and obtaining their bytecode on thaw. Eval PMCs would no longer manage the bytecode for all contained subs for freeze/thaw as these are now responsible for handling that themselves.
= Benefits =