Pavel Voronin
Pavel Voronin

Reputation: 13985

Why does not FSharp.Core.dll contain major version in its name?

Why does not FSharp.Core.dll contain major version in its name? Won't it help to solve binary compatibility issues?

As far as I understand when authoring a library developed in F# it should have a dependency on FSharp.Core.dll NuGet package with upper version limit as <CurrentMajor+1. Upper version mustn't stay unconstrained because binary compatibility is guaranteed only between libraries having same major version. Just a semantic versioning model.

Let's now imagine a library which is useful, has no bugs and logically finished. In other words there is no more need to support it. Period.

Then F# 5 is released and ... users of the library cannot use it anymore in projects referencing libraries created with F# 5.x


Ok, the upper statement is a mistake
(For F# 2, F# 3 and F# 4 FSharp.Core library had versions 4.x.y.z.)

Nevertheless, the question stays valid.

At some point in time major version will be increased to 5. This supposedly will break binary compatibility. (Why otherwise would you make an increment?)

Here is what I mean:
Project references NuGet.New and NuGet.Old.
NuGet.Old references FSharp.Core.dll [4.x.y.z, 5.0.0.0)
NuGet.New references FSharp.Core.dll [5.0.0.0, 6.0.0.0)
NuGet won't allow it. It is a version conflict.

Actually I confronted with the similar problem yesterday (4th Dec 2018) when EF Core 2.2 NuGet package was already available, but Sdk for ASP.NET Core 2.2 did not.

Micrsofot.AspNetCore.App metapackage pinned version of EF Core to the range [2.1.0, 2.2.0). After I referenced EF Core 2.2 in my DAL project the whole solution stopped building because of version conflict.


However, if it were FSharp4.Core.dll and FSharp5.Core.dll they could work side by side.

Yes, conventions and shapes of CLR types which represent same concepts of F# 4.x and F# 5.x can differ, but compiler can tag a type with its major version. This will not only help to distinguish new objects from the old ones, but can allow new compiler to silently create code for adapting old types to new version.

Upvotes: 1

Views: 125

Answers (1)

Phillip Carter
Phillip Carter

Reputation: 5005

The major language version is the first number in the package and binary version as of F# 4.5.

FSharp.Core is binary compatible. In your scenario, Users of F# 5 would still be able to use the older library. Failing to do so would be a bug.

Upvotes: 4

Related Questions