Sharing is a constant complication and advantage of the hdiff approach.
We do see interesting things related to it, for example, patches have some sort of
eta-inequality:
[0] -|+ Bin [0] Leaf > Bin [0] [1] -|+ Bin (Bin [0] [1]) Leaf
This has implication on merging, for example.
One option for controlling sharing can be seen in here, where we pass around a function
that decides to add some prefix to the hash of certain AST elements. The big issue is that
if we rename a function, we loose sharing of its contents.
I'd like to have a better story here. How to actually control that we want to share all the variables named "aux" that occur inside the same function, but not outside the function scope, for example.
Naturally, this has to be resistent to function renaming. Upon seeing a rename, we must be
able to detect that the body should be shared.
(very loose notes follow)
Sharing is a constant complication and advantage of the
hdiff
approach. We do see interesting things related to it, for example, patches have some sort of eta-inequality:This has implication on merging, for example.
One option for controlling sharing can be seen in here, where we pass around a function that decides to add some prefix to the hash of certain AST elements. The big issue is that if we rename a function, we loose sharing of its contents.
I'd like to have a better story here. How to actually control that we want to share all the variables named "aux" that occur inside the same function, but not outside the function scope, for example. Naturally, this has to be resistent to function renaming. Upon seeing a rename, we must be able to detect that the body should be shared.