4 ms·
Interesting idea, but isn't code addressable already in most languages? We call them modules/libraries and we pip/npm install them from Github and you can keep
by csantini 3y ago
Interesting idea, but isn't code addressable already in most languages?
We call them modules/libraries and we pip/npm install them from Github and you can keep track of changes/versions/PRs.
- kitd 3y agoContent-addressable, not code addressable. It's kind of like global, distributed memoization (IIUC). edit: not memoization, just hashing the AST of a function.
- throwaway290 3y agoContent is by definition content addressable. x = 42 is a hardlink to every other instance of x = 42 if you will. What this does is more compact and practical content addressing, like Nix or Git. But realizing that there are always more than one way of expressing the same logic (with different hashes no matter how you canonicalize) makes me doubt it is a killer feature.
- trenchgun 3y agoContent addressable has a very specific meaning: https://en.wikipedia.org/wiki/Content-addressable_storage https://en.wikipedia.org/wiki/Content-addressable_storage Modules and libraries are addressable based on their names or URI:s. "Unison eliminates name conflicts. Many dependency conflicts are caused by different versions of a library "competing" for the same names. Unison references defintions by hash, not by name, and multiple versions of the same library can be used within a project." https://www.unison-lang.org/docs/what-problems-does-unison-solve/ https://www.unison-lang.org/docs/what-problems-does-unison-s... "Here's the big idea behind Unison, which we'll explain along with some of its benefits: Each Unison definition is identified by a hash of its syntax tree. Put another way, Unison code iscontent-addressed. Here's an example, the increment function on Nat: increment : Nat -> Nat increment n = n + 1 While we've given this function a human-readable name (and the function Nat.+ also has a human-readable name), names are just separately stored metadata that don't affect the function's hash. The syntax tree of increment that Unison hashes looks something like: increment = (#arg1 -> #a8s6df921a8 #arg1 1) Unison uses 512-bit SHA3 hashes, which have unimaginably small chances of collision. If we generated one million unique Unison definitions every second, we should expect our first hash collision after roughly 100 quadrillion years! " https://www.unison-lang.org/docs/the-big-idea/ https://www.unison-lang.org/docs/the-big-idea/
- flir 3y agoSeems like identifying your library with a git tag would drop that risk to zero. I guess what I'm not understanding here is the utility. Why is it useful to include multiple versions of a library in a project? Is this a limitation I've been coding around without knowing it?
- celeritascelery 3y agoHave you ever had problem where two of your dependencies are each using a different version of the same library? Or have you ever wanted to incrementally upgrade an API so that you don’t have to change your entire code base in one fell swoop? That is where things like Unison or scrapscript can make it very easy.
- flir 3y agoOk, I can see "incremental upgrade" as a use-case. Thanks.
- penteract 3y agoOne reason for multiple versions of a library in a project is that the project wants to use 2 different dependencies, which themselves depend on incompatible versions of a third library.
- flir 3y agook, yep, that's one I've had myself. Thanks.
- cnity 3y agoI recommend reading the benefits section in the Unison docs[0]. 0: https://www.unison-lang.org/docs/the-big-idea/#benefits https://www.unison-lang.org/docs/the-big-idea/#benefits
- computerfriend 3y agoTags are not immutable.
- throwaway290 3y agoThat does not sound like it could make any money though...