Version numbers - to 'v' or not to 'v', that is the question

Hi There,

I’ve noticed that a lot of Erlang projects use a ‘v’ prefix for version tags and a lot of Erlang projects don’t!

Having finally installed emqtt by changing from ‘v’ to non-‘v’ prefixed version number (v1.2.0 should be 1.14.4), I would like to know: what is the common practice now?

For me, it seems that there is a shift away from ‘v’ prefixed release tags - is that the case? Or does each project do their own thing?

b.t.w. is emqx/emqtt the go-to MQTT library for Erlang or is there something else?

2 Likes

Hi there,

Great question! In practice, the use of a v prefix in version tags varies from project to project and often depends on the preferences of the maintainers. There isn’t a strict standard in the Erlang community - some projects use v1.2.3, others just 1.2.3. However, when it comes to automated tools like Docker image builds or CI/CD pipelines, it’s often safer and more consistent to stick to strict Semantic Versioning (SemVer) without a prefix, unless the toolchain explicitly expects one.

Regarding EMQX/emqtt - it’s currently one of the most mature and actively maintained MQTT libraries for Erlang. If you’re building an MQTT-based system in Erlang, it’s generally considered the go-to solution. That said, depending on your needs (embedded broker, lightweight pub/sub, etc.), you might want to review alternatives or fork for more custom behavior.

Hope this helps!

3 Likes

Yep it did :slight_smile:

Thanks for the clear explanation and yep, I’ll move to Semver instead of the ‘v’ prefix.

I did actually assume it was an Erlang practice to use the prefix, good to know that I was wrong.

emqtt seems to match my needs, so I’ll stick with it. It seems to support everything and more than I need.

Cheers for the quick response :+1:

1 Like

FAQ of Semver page is clear about that :

'Is “v1.2.3” a semantic version?

No, “v1.2.3” is not a semantic version. However, prefixing a semantic version with a “v” is a common way (in English) to indicate it is a version number. Abbreviating “version” as “v” is often seen with version control. Example: git tag v1.2.3 -m "Release version 1.2.3", in which case “v1.2.3” is a tag name and the semantic version is “1.2.3”.’

3 Likes

Thanks for the clarification!

The reason I asked was because of the release numbering over at emqtt - the latest tag is 1.14.4 however they had a version v1.2.0 in their readme - v1.2.0 was four years old, while 1.14.4 is brand new!

They dropped the ‘v’ in their release numbering and that was a little confusing since I thought v1.2.0 was greater than 1.14.0, which it wasn’t.

I assumed that the ‘v’ meant something since it was in their readme as the version that one should be installing. Until I discovered that they hadn’t updated their readme :slight_smile:

25.04 is the proper version.

Semantic version is usually a lie, software nowadays usually cannot be developed in this way.

v is a useless prefix when you put a version, however it can be a good prefix for a tag

One thing worth remembering is that v1.2.3 is a perfectly good unquoted atom in Erlang syntax, while 1.2.3 isn’t anything. In a world that contains IPv4 addresses and OIDs as in ASN.1, a v prefix can be a useful reminder to people that it’s a version number.

The wuestion I’d ask is “do the tools I use make one convention substantially easier to follow than the other?”

It’s not. v1.2.3 doesn’t parse unquoted.

Good point, that make a lot of sense and explains it.

That’s the thing, the tools/libraries have a mix of ‘v’ and not ‘v’ - hence it’s not that simple. Also there seems to be errors in Elixirs mix when using ‘v’ prefix - probably because mix is using a strict interpretation of semantic versioning.

So my estimate would be that ‘v’ prefix was preferred because it made an Erlang atom out of a version number but with the increased usage of mix, the ‘v’ prefix is being dropped because the ‘v1.2.3’ form isn’t a correct semantic version and causes errors when using mix.