elm / elm-lang.org

Server and client code for the Elm website.
http://elm-lang.org/
BSD 3-Clause "New" or "Revised" License
1.99k stars 366 forks source link

Inaccuracy: Elm does not enforce semantic versioning #868

Open not-my-profile opened 3 years ago

not-my-profile commented 3 years ago

The homepage currently promotes the following feature:

Enforced Semantic Versioning

Elm detects all API changes automatically thanks to its type system. We use that information to guarantee that every single Elm package follows semantic versioning precisely. No surprises in PATCH releases.

However that's simply not true. An API is more than its types: behavior is also part of an API.

To illustrate this with a simple example:

module MyAPI exposing (..)

{-| Always positive.
-}
maxSize : Int
maxSize = 3

If you insert a - before the 3 and release a new PATCH version: BOOM, you have just broken SemVer!

Elm does not "guarantee that every single Elm package follows semantic versioning precisely". You can intentionally break it and for complex functions you might even break SemVer without realizing it.

Edit: I have since learned that Elm can in fact prevent semantic versioning, as described in https://github.com/elm/compiler/issues/2099. So elm does in fact enforce an incorrect interpretation of semantic versioning.