Re:Sir, Please Step Away from the ASR-33 (2010)
by auggierose on Sunday June 27, 2021 @11:19AM
(#27652250)
No, because the mangled names still depend on the names ...
[ Parent
| on HN ]
Re:Sir, Please Step Away from the ASR-33 (2010)
by tyingq on Sunday June 27, 2021 @11:32AM
(#27652360)
Not sure I get the distinction. Hashes "depend" on the name as well. You perhaps can't (easily) unmangle, but it's still a derivation.
Re:Sir, Please Step Away from the ASR-33 (2010)
by breuleux on Sunday June 27, 2021 @12:24PM
(#27652867)
From what I recall from looking at Unison not long ago, the hashes do not depend on names. `f x = x * x` and `g y = y * y` both have the exact same hash and are considered to be the exact same function. Any call to `f` or `g` will be stored as a call to their hash, so `f2 x = f (x + 1)` and `g2 x = g (x + 1)` would also have identical hashes.
This does appear to pose a small issue for types, since isomorphic types are identical regardless of their names, but I believe they have a way to attach a unique id to enforce a distinction.
Re:Sir, Please Step Away from the ASR-33 (2010)
by tyingq on Sunday June 27, 2021 @12:25PM
(#27652873)
Ah, that makes it more clear.
Re:Sir, Please Step Away from the ASR-33 (2010)
by lisper on Sunday June 27, 2021 @11:45AM
(#27652478)
I am not really familiar with Unison, but I presume it works like this: Only the code itself is hashed. The then-current name is then added as an annotation. When you refer to a name, the language compiler looks up the hash currently associated with that name and stores the hash instead of the name. When code is rendered, the name associated with the hash at render-time is looked up and displayed. That way if the name is changed, all of the renderings generated after that automagically use the new name.
It's actually quite a clever idea.