PeachPy
PeachPy copied to clipboard
Deterministic output
Every time I regenerate the assembly for https://github.com/dgryski/go-highway with python3, some of the labels change. This makes it difficult to isolate a small change in the source file with a small change in the output.
This is caused by iterating dict keys in https://github.com/Maratyszcza/PeachPy/blob/master/peachpy/name.py#L91 This could be fixed by assigning a function-global name id each time an object with a name (LABEL
or instruction with Constant
) is added in Function.add_instruction
and sorting by these names in the loop. I don't have time to fix it now, but a PR would be welcome!