5 ms·
Identified by its content how?
by slver 5y ago
Identified by its content how?
- auggierose 5y agoHashing, like in Git I guess built-in things get fixed names / hashes, and the hashes of everything else follow from that. They need a mapping from content/hashes to human-friendly names, obviously. Not sure if they gained anything here, but they seem to think so, so might be worth checking this out.
- slver 5y agoI don't know why we keep reinventing this distribution model and failing at it, then trying again. Bugfixing and identity matter.
- fzzzy 5y agoUh, could you explain more? Your comment doesn't really give any clues about what you are complaining about.
- tyingq 5y agoSounds like C++ name mangling.
- auggierose 5y agoNo, because the mangled names still depend on the names ...
- tyingq 5y agoNot sure I get the distinction. Hashes "depend" on the name as well. You perhaps can't (easily) unmangle, but it's still a derivation.
- lisper 5y agoI 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.
- asoltysik 5y agoYou presumed right, that's how it works ;)
- breuleux 5y agoFrom 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.
- tyingq 5y agoAh, that makes it more clear.
- deleted 5y ago[deleted]