Should I update the Elixir version of a mature library?

I released a parser combinator library Ergo about 3 years ago. It was based on, then current, Elixir 1.13.

I’ve been using the library since then and it’s been pretty stable. But now I find myself needing to make some modifications and I don’t even have 1.13 (Erlang 24.2) on my system.

It’s easy enough to install them using asdf but I’m wondering should I update it to a later version of Elixir? If so, which one?

What should you do for long-term maintainability?

Long-term, when you are a library author you should accept the minimum realistically possible Elixir version. AFAIK Erlang 24.X is not actively maintained, last patch was back in April the 9th: Patch Package OTP 24.3.4.17 Released - Erlang News - Erlang Programming Language Forum - Erlang Forums.

So IMO use the oldest actively maintained Erlang version + whatever low version of Elixir you can get away with. This has the following limitation:

If the minimum Elixir version you have in mind even supports the minimum Erlang version that’s maintained. This compatibility matrix should help you make this decision: Compatibility and deprecations — Elixir v1.17.2

In this case, and as of 09-SEP-2024, it seems like supporting Elixir 1.14+ and Erlang 25+ as a minimum is reasonable.

Though, disclaimer: the fact that Erlang 24 hasn’t received patches since April the 9th does not mean that it is no good. And if you don’t need some of the more recent Elixir APIs maybe you are fine staying on the oldest possible Elixir version; many projects are very conservative about upgrading Erlang / Elixir so they might benefit from your library even farther into the future.

Thanks Dimitar. This seems like a reasonable position to take. In fact I found a way around the need to update the library, but maybe I should update the versions as a way of signalling that Ergo is actively (if not often) maintained.

M

1 Like

An easy way to accomplish this is using mise or asdf, where you put the versions in a .tool-versions file in your repo, in which I simply switch between the recent versions I actively develop with and the oldest versions I support by (un)commenting them:

erlang       27.0.1
elixir       1.17.2-otp-27
# erlang       25.3.2.8
# elixir       1.13.4-otp-25