<div dir="ltr">I don't actually see the problem in producing a hash of the API you use.<div><br></div><div>It is simply the hash of the list of your imports.</div><div><br></div><div>Is this overspecific? In the sense that it is more restrictive than it could be?</div><div><br></div><div>Yes, but at least you get reproducibility and a permanently working build.</div><div><br></div><div>Semantic versioning sounds good in theory and often works in practice, but you are relying on the goodwill and the precision of the library maintainer when both of these qualities are in short supply.</div><div><br></div><div>The advantage of using module-level hashes is that you:</div><div>* Avoid mistakes due to incorrect semantic versioning<br></div><div>* Get maximum flexibility, as you are exploding the 'package cage' and accessing every file individually</div><div></div><div>* Avoid a lot of 'false incompatibilities', when for example you would like to access a new version of a module in an upgraded package but you can't upgrade because you depend on another package that declares to be compatible only with the previous version of the package you want to upgrade to even when it's not actually using the new module you are interested in at all.</div><div><br></div><div>The inconvenience of hashes is that they are cumbersome to manage by hand, but this can be automated.</div><div><br></div><div><div><br></div><div>In fact, the question is not really semantic versioning vs hash-versioning. Both can be used at the module level as well as to the package level.</div><div></div></div><div> </div><div>The question is if we can simplify the dependency management problem by "going smaller", moving from a bunch of related modules (a package) as a unit of code exchange to a single module.</div><div><br></div><div>In principle one could even go smaller, considering every function or data type [1] as an independently sharable entity.</div><div><br></div><div>So, what is the optimal 'size' for code sharing: package, module, or entity?</div><div><br></div><div><br></div><div>Best,</div><div><br></div><div> titto</div><div> </div><div><br></div><div><br></div><div>[1]</div><div>This actually make a lot of sense if you are interested in cross-language interoperability, see <a href="https://github.com/Quid2/zm">https://github.com/Quid2/zm</a> for an example.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno ven 11 dic 2020 alle ore 18:02 Joachim Durchholz <<a href="mailto:jo@durchholz.org">jo@durchholz.org</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Am 11.12.20 um 13:48 schrieb Pasqualino "Titto" Assini:<br>
> I always wondered: do we need a package management system at all?<br>
<br>
The main reason package management became a thing is indirect dependencies.<br>
<br>
Without package management: Pick up a dependency, manually hunt down <br>
everything that it depends on, then get the dependencies' dependencies, <br>
and you never know how many are there to come.<br>
Lather, rinse, repeat with every update. Sometimes you'll need a <br>
completely new set of indirect dependencies after an update.<br>
<br>
With package management, you specify the package you need and the <br>
package manager will do the rest.<br>
It should also tell you what it pulled in.<br>
If it's worth anything, you can tell it to use different dependencies; <br>
it's not a silver bullet that will solve your dependency <br>
incompatibilities for you, but it will give you a reasonable first <br>
approximation.<br>
<br>
> What about a system where every source file is automatically annotated <br>
> with a unique hash and all the required LANGUAGE extensions.<br>
<br>
Hashes are... difficult.<br>
<br>
What you really want is a hash of the API you're using, possibly <br>
including nonfunctional properties. Problem is that it's really hard to <br>
even define the section of the API that you need - probably an unsolved <br>
problem, actually.<br>
<br>
That's why people find semantic versioning so important.<br>
Usually, you have some global namespace where legal entities reside <br>
(Java did something that turned out to be pretty smart: domain names are <br>
per-entity anyway), with each entity assigning module names within their <br>
namespace.<br>
E.g. the owner of com.company manages com.company.module1, <br>
com.company.module2, etc.<br>
A module is identified by (sub)domain name and version number, throw in <br>
some recommendations about how to apply semantic versioning, and people <br>
will stop using those modules that don't have a good versioning policy <br>
anyway... and you're done.<br>
<br>
It's not perfect, but it works.<br>
<br>
(Hashes are overspecific, and they don't help with the relationship <br>
between version 1.2 and 1.2.2 of a module.)<br>
<br>
(Disclaimer: This is from the perspective of the Java ecosystem, <br>
slightly generalized. Semantic versioning may be less of an issue for <br>
functional languages than it has been and will be for imperative ones, <br>
so I don't expect this to carry over 1:1.)<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr">Pasqualino "Titto" Assini<br><div><a href="http://networkpolitics.svbtle.com" target="_blank">http://networkpolitics.svbtle.com</a></div><div><a href="http://quid2.org/" target="_blank">http://quid2.org/</a><br><br></div></div></div></div></div>