--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hello Gophers!Yesterday I attended a tech meetup and was introduced to the Elm language. The one thing that really stuck with me was how the Elm package manager handles semantic versioning for the package developers. As soon as things are added to the packages API, the minor version of the package is automatically bumped, and if the existing API of the package is changed, the major version is bumped.
--
I thought about this too, but came to the conclusion that this would first require a good definition of what "API breakage" actually means.
In it's strictest interpretation as "any go package that imports this will continue to build", there are literally no changes you could make to the API that wouldn't require a major version bump. Which is a correct, but useless implementation of semantic versioning.
So you need to make exceptions for (at least) dot-imports and embedding. But I don't really think it's reasonable to require people to not embed things. It's a powerful and important mechanism of composition.Leaving aside my general belief, that semantic versioning is a broken idea, there still is the additional issue that the API isn't mapped completely by the type system. There are things (usually described in comments) that can break, that can't be automatically determined. So at the very least, you'd also need a way to override this mechanism and manually inject breakage-points (while, at the same time preserving the option to continue to use the mechanism in the future).I am not convinced this is a good idea, but as long as there continues to be the option to develop without package managers and versions, I can't think of a reason for you not to do it :)
On Wed, Oct 26, 2016 at 9:45 AM, Martin Bertschler <mbert...@gmail.com> wrote:
Hello Gophers!Yesterday I attended a tech meetup and was introduced to the Elm language. The one thing that really stuck with me was how the Elm package manager handles semantic versioning for the package developers. As soon as things are added to the packages API, the minor version of the package is automatically bumped, and if the existing API of the package is changed, the major version is bumped.I think this could be a great idea for the new package manager, since the whole Go ecosystem values stability and great tooling a lot. Some benefits of this feature that I can imagine:
- Not having to think about the next version number, especially in small projects where I just want to publish some new code. Let the tool just choose one for you.
- No accidental changes the public API during development, the tool would point out the API changes to you before publishing. If you didn't intend the change you could fix it.
- Always correct usage of semantic versioning, that the whole ecosystem can depend on. This could enable automatic updates to always the newest patch version.
Implementing it should not be hard because we already have things like https://golang.org/cmd/api/.The full specification on how Elm handles that can be found here: https://github.com/elm-lang/elm-package.What are your thoughts on this matter?Best,Martin
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.