News for hackers. Stuff that matters.
Re:Libyear by IanCal on Thursday May 09, 2024 @07:06AM (#40306947)
Isn't "we are 5 major releases behind" more obvious that "two libyears".

> If your system has a one year old dependency and a three year old dependency, then your whole system is four libyears old.

How far down the tree do we go? Either fully, which means that one project with 365 one day old dependencies is 1 libyear old. Or not at all, as the rails example suggests, in which case if I have a wrapper around rails that I bump to an old rails version, anyone using my wrapper would have older rails but a fewer libyears?

There is no single answer to all of this, because it's too complex to boil down to a single number. But I think it's a bit odd to introduce a whole new thing that doesn't measure at all what's changed.

Re:Libyear by eadmund on Thursday May 09, 2024 @07:28AM (#40307082)
I had the same immediate reaction that you did, but the key here is that the age of dependencies is not absolute but calculated against the latest release. So a one-day-old dependency with no succeeding version is 0 libyears old, not 1/365.24. Likewise for a decade-old release, if it is in fact the latest release.

It’s about the time delta between the used version and the latest available version.

Re:Libyear by thih9 on Thursday May 09, 2024 @07:50AM (#40307228)
But this still means that you're either on the latest version or 39 libyears behind (if you count all dependencies of dependencies of dependencies...)
Re:Libyear by robertlagrant on Thursday May 09, 2024 @08:03AM (#40307307)
Adding transitive dependencies might be tricker, because then you can't tell what of your direct dependencies to upgrade.

It might be more useful to assign each direct dependency's transitives to it, and then you can do maths to figure out whether updating a direct dependency actually has an effect (e.g. 2 directs both with a 50 lib year dependency aren't worth upgrading unless you upgrade both of them.)

Re:Libyear by tlb on Thursday May 09, 2024 @07:56AM (#40307257)
I think each dependency is only counted once, even if it’s recursively included many times.
Re:Libyear by calpaterson on Thursday May 09, 2024 @07:28AM (#40307079)
> There is no single answer to all of this, because it's too complex to boil down to a single number.

Having a single number that is a rough measure is still useful, though perhaps a (weighted?) average would be more useful.

Anyway, I just downloaded the Python tool (called "libyear" on PyPI) and ran it to quite quickly find three dependencies on my project that were over 2 years behind. That was helpful and I would use it again.

Re:Libyear by d-k-bo on Thursday May 09, 2024 @07:10AM (#40306968)
I think it only counts direct dependencies.
Re:Libyear by falcor84 on Thursday May 09, 2024 @07:36AM (#40307121)
So that means that the way to game this would be to create a wrapper project (e.g. called "external_deps") for all of my dependencies, and then have my actual project depend on that one. So I'm externalizing all of my tech debt onto external_deps and as long as I never make a new release of that, my main project will always be 0 libyears old.
Re:Libyear by riffraff on Thursday May 09, 2024 @08:05AM (#40307319)
Even if you could, why would you? It'd be the same to, say, fork a projectX to myprojectX and say you're at the latest version.

You are the one that has an advantage to know you're behind, not someone else.

Re:Libyear by alanbernstein on Thursday May 09, 2024 @08:09AM (#40307353)
Wouldn't it be easier to "game" the tool by just not using it?
Re:Libyear by PokestarFan on Thursday May 09, 2024 @08:07AM (#40307340)
Look up Goodhart's Law.
Re:Libyear by gwbas1c on Thursday May 09, 2024 @09:33AM (#40308058)
> So that means that the way to game this would be to create a wrapper project (e.g. called "external_deps") for all of my dependencies, and then have my actual project depend on that one

No, you can't resort to chicanery to manipulate your metric.

In this case, the libraries you want to use become transitive dependencies, but if your code uses those transitive dependencies, then your project still depends on them.

Re:Libyear by IanCal on Thursday May 09, 2024 @06:59PM (#40313786)
Then the rails example on the main page is wrong.
Re:Libyear by WorldMaker on Thursday May 09, 2024 @06:42PM (#40313685)
People already do that with vendorizing, too. It was noted the other week on HN of someone "collateralizing" their tech debt by vendorizing a dependency to remove CVE/deprecation/obsolescence warnings for a Rust dependency with no update path: https://news.ycombinator.com/item?id=39827645

A metric like this can't keep you honest (just about no matter how you design it, people will find loopholes), but it can help honest people document their needs.

Re:Libyear by stevepike on Thursday May 09, 2024 @09:12AM (#40307877)
They're tracking different related things. I run a startup in this space and we track: aggregate libyear of your direct dependencies; total # of direct dependencies with libyear > 2; # of direct dependencies at least one major version behind; dependencies that have been abandoned by the maintainer.

I think the top-line aggregate libyear number is helpful to monitor over time to get a general sense of the slope of your technical debt. If the number is trending upwards then your situation is getting worse and you're increasing the chance you find yourself in an emergency (i.e., a CVE comes out and you're on an unsupported release line and need to go up major versions to take the patch).

Tracking total # of major versions behind gets at the same thing but it's less informative. If you're on v1 of some package that has a v2 but is actively releasing patches for the v1 line that should be a lower priority upgrade than some other package where your v1 line hasn't had a release in 5 years.

Re:Libyear by IanCal on Thursday May 09, 2024 @06:58PM (#40313775)
It feels like it just has so many weird edge cases. A stable 2.3 branch that hasn't changed while the 1.2 branch has major security issues punishes you for not using the 1.x version.

A regularly updated 1.x branch for docs/security looks like you're doing fine even though the project is on 3.x and deprecating soon.

Perhaps as a vague guide to point to potential issues, sure.

Re:Libyear by gwbas1c on Thursday May 09, 2024 @09:35AM (#40308087)
What's nice about the "libyear" concept is that it exposes the cost of indiscriminately pulling in 3rd party libraries.

IE, it discourages someone from sucking in a library just to use one tiny function that they could recreate in 10-15 minutes.

Re:Libyear by IanCal on Thursday May 09, 2024 @06:46PM (#40313716)
That sounds entirely orthogonal to the goal, which isn't a good thing for a metric.