Register or not register (tiny packages)?

In a few recent threads there are discussions about the appropriateness of tiny packages with trivial code in the General registry. Those threads started discussing specific cases of packages that only have a couple of simple, small functions, or that the only thing they do is reexporting a bunch of modules from the stdlib and other packages.

I was reading the arguments, which in their majority discourage the registration of such packages. As a very coarse and amalgamated summary of those arguments, Iā€™d say that the reasons for such discouragement is that:

  • a registry widely populated by packages like those might become chaotic and brittle; and
  • it increases the probability of ā€œgood namesā€ being taken by packages that are not that much relevant.

Those are good reasons, although @StefanKarpinskiā€™s comment in one of those threads implies that there are means to soothe the impact of those problems (i.e. irrelevant or unmaintained packages can be detected an archived, and name duplicity is manageable).

On the other hand, there is a point in developing such tiny packages, specially if both types (packages with trivial functionalities, and packages that put together other packages) are considered. That is a perfectly fine way of making bigger packages incrementally. Actually, sometimes I have read people encouraging others to create such small packages when there is a proposal to incorporate some new functionality, instead of directly making a PR to Julia.

So, I think that the question is not whether those packages are ā€œgood enoughā€ or not in general terms ā€“ Iā€™d say they are, but whether they belong in the General registry. This is my take on this question:

  • If your small package is something very experimental, not yet to be used in production, and what you want is that people test it and give feedback, donā€™t register yet. Probably there is no point in keeping those exploratory versions available to be easily add-ed in the future, itā€™ll be easier to rename it, less remorse if you eventually abandon it, etc.
  • On the other hand, if the package is so simple that you think that it might live forever as it is, regardless of changes in the Julia ecosystem, etc., donā€™t register it either. The only interaction of the package manager with your package should be add it or remove it. Thatā€™s fine with an URL.
  • Now, if the package has dependencies that may break as soon as they have significant changes, or the package itself may experiment changes that could break the usersā€™ code, then do register, so that updates can be dealt with wisely by the package manager.

(Note: Iā€™m assuming here that registered packages can depend on unregistered ones, but Iā€™m not sure. If it is not like that, then case #2 can be ā€œdo registerā€ too).

I think these are general rules of thumb, no matter whether the package is small or big. Only that tiny packages are more likely to fall in the first two cases.

An additional reason why developers may want to have their packages registered, even if they donā€™t need to, is because that will make them easier to discover by search engines based on the registry (e.g. Juliahub, Julia Packagesā€¦). But at least the latter uses other sources, so for instance popular packages in Github should also be found, registered or not.

1 Like

I recently figured how to setup my own (private) registry using RegistryTools.jl. This way you can

  • register tiny packages w/o cluttering the General Registry
    and
  • let the package manager figure out the versions and dependencies etc.

For me this is a perfect setup.

3 Likes

If I may suggest, a blog post or tutorial on how to do this would be awesome.

Or even better, a PR to the README of RegistryTools.jl.

There is also https://github.com/GunnarFarneback/LocalRegistry.jl

2 Likes

I wrote a small tutorial:

2 Likes

While itā€™s certainly possible to create a registry and register packages directly with RegistryTools, I wouldnā€™t really recommend it other than as a learning experience. LocalRegistry provides a considerably more user friendly interface.

5 Likes