Overall, I would also like to see better support for compatibility automation...
On Sun, 24 Mar 2013 15:58:09 -0700 (PDT)
Evan Chan <
vel...@gmail.com> wrote:
> I realized the devil is in the details.
>
> The most useful thing for people is, are the APIs they are using right now
> going to change? However, this requires storing all of the API details
> with each package, because the details will get hashed away.
>
> Here is a reasonable proposal, I think:
> - Compute the hash of a package's API in such a way that you can deduce how
> far the API has changed between any two versions/hashes, just by
> subtraction.
> (for example, hash code = 10 * (sum of class name hashcodes) + (sum of
> method signature hashcodes). A new class causes the overall hashcode to
> increase much more than a change in a method signature).
A reasonable hash code, such as of the class name String, will be reasonably evenly distributed among ints, so there isn't a meaningful sense of 10*<hash-code> being more or less than <hash-code>. There would have to be hash codes for method signatures and class names that would give that meaning and it would probably still overflow often enough to ruin it.
> - For a given package, adept would be able to estimate how much the API has
> changed in future versions. For example, for Akka:
>
> package akka.actor
> v2.0.3: +3%
> v2.0.4: +5%
> v2.1.0: +20%
This would make for a nice demo and that alone might be worth it. In practice, as you say, we ultimately care whether it is drop-in binary and/or source compatible. Hashes will give an approximation to that, but there will be situations where it is compatible for a particular client but the hashes don't have enough information to prove it. How common are those situations and is this useful despite that?
If you could say "the current binary API of the package or class is 4a3b83 + 9e223f", then you'd know that something that runs against 4a3b83 will work with the current API. Doing that seems plausible, but it only handles additions and not deprecations/deletions. It seems like deletions make it more complicated, but maybe there's a nice solution waiting here.
As far as the dependency manager is concerned, if this isn't used for dependency resolution, it is just additional metadata. As long as there is a way to encode custom structured information in the metadata, adept is fine. It is only when the information is needed for resolution. Something like "I need binary version 4a3b83 of akka" would be involved in resolution, but "akka v2.0.3 is +3% different from akka v2.0.4" would not and could be provided by code/a plugin on top of adept.
It is overall a good thing to continue to discuss and it could still fall within the scope of adept. I'm just trying to establish the core feature set that would support these additional (but possibly killer) features.
-Mark
> If someone wanted the details of the API changes, then they (or Adept)
> could download the jars and actually examine the API differences, perhaps
> using a tool such as Clirr.
>
> I can see this being used by companies to enforce certain compatibility
> standards.
>
> -Evan
>
>
>
> On Sunday, March 24, 2013 10:24:37 AM UTC-8, Paul Phillips wrote:
> >
> >
> > On Sun, Mar 24, 2013 at 1:14 AM, Evan Chan <
vel...@gmail.com <javascript:>