Proposal for how Carbon version numbers work:
We need a versioning scheme for Carbon both for the language and the reference toolchain implementing that language. This is important even before we reach any specific milestone, as we want to define the schema and implement it before it becomes useful for marking specific milestones.
First, Carbon should have a single versioning scheme across both the language itself and toolchain, including the standard library, compiler, linker, and all development tools released by the main Carbon project.
Second, the Carbon versioning scheme should conform to and be closely based on Semantic Versioning (SemVer), which is the de-facto standard for versioning schemes in software today. Beyond that, it needs to clarify how the standards laid out in SemVer map into a programming language context as programming languages and standard libraries have an extraordinarily broad and tightly coupled "API" to their users -- all of the source code written in the language. Carbon needs to provide extra clarity around what constitutes our "public API" for SemVer purposes and the criteria for changes.
Third, SemVer provides a schema for pre-release versions, but is largely open-ended on their semantics. Carbon should have a specific set of well defined pre-release versions with clearly communicated purpose, nature, and meaning to avoid confusion.
Fourth, language versioning is an especially important area for the long-term evolution and so Carbon should have some directional guidance around the future work expected in the versioning front. This should speak to specific use cases and needs that may be left seemingly unaddressed otherwise.
Summarizing the proposed outcome of these together:
MAJOR.MINOR.PATCHMAJOR increments on backwards incompatible changes, including a
deprecation that might trigger a build-breaking warning.
MINOR increments only expected during early development with a major
version of 0.
PATCH increments represent bug fixes only.
MAJOR.MINOR.PATCH-rc.N: The N-th potentially viable candidate for a
release.MAJOR.MINOR.PATCH-0.nightly.YYYY.MM.DD: A nightly incremental
development build on a particular day during development of that
version.MAJOR.MINOR.PATCH-0.dev: An interactive, incremental development build
on a particular day by some developer during development of that
version.See the added versioning document.
The mechanics outlined above provide a good basis for the initial versions of the language (up to 1.0) and any necessary mechanics and tooling around those versions. However, beyond 1.0 we expect the needs of the language and project to expand and more detailed versioning and evolution tools to become critical. We lay out directional sketches here for where Carbon should go in the future to address these needs, but these are just directional guidance and will need their own carefully considered proposals when the time comes.
We don't expect a simple version number to be sufficient long-term for the evolution needs of the Carbon language. We should plan to at least map these major versions into Rust-edition-like controls within source code itself to allow incremental adoption across a codebase of fixes for breaking changes or adoption of new language features with a single toolchain version. That is, some code will want to compile using previous major version semantics even with the new compiler.
The approach taken in Rust and proposed for C++ to address this are "editions" that source code opts into in order to allow the compiler to support a mixture of code in a codebase during incremental adoption. Carbon will need at least something equivalent to this, and may want to explore a more fine-grained system of opting into specific functionality sets similar to how pragma-based extension usage or Circle works.
Regardless of the specifics, a key is that breaking changes are not forcibly coupled in their roll-out to updates to the Carbon toolchain. Each step needs to be incrementally tackled.
SemVer alone isn't sufficient to address some user needs for language stability. It is enough to detect the issues when they arise, but Carbon should also plan for how to address these issues.
The suggested direction here is towards designated LTS versions based on a particular level of completeness and quality and the user demand. These versions will likely need even longer time horizons of support than Linux distro LTS releases. The direction should be to embrace this and the potential for multi-decade support windows to support users' needs. As the windows of LTSes expand, their frequency should reduce to avoid supporting an unsustainable diversity of versions.
Exactly how a version is designated as LTS is left to the future work here, but it should not be expected to change the schema and structure of the versioning, just the support policy applied to the specific release version in question.
Some users may even require standardization of a programming language to make it usable in their environment. Carbon should again embrace this need and see the standardization as an analogous process to promoting a normal release into an LTS. Some relevant and effective LTS should be selected and taken through whatever process is identified to create a standard reflecting that LTS version of Carbon. Updates to the standard should in turn track as updates to a newer LTS. The specifics of how to do this are left to the future work, and they may change exactly how this works.
Note that the goal of this future direction isn't to constrain how Carbon can arrive effectively at either an LTS release or a standard. Instead, the goal is to make it clear that we should be open and planning to achieve these in order to meet the needs of candidate Carbon users.
Advantages:
Disadvantages:
A key to adopting the more detailed versioning plan is that we can change any and all of this if and when we need to. This does not lock Carbon into using this exact versioning scheme. We will listen to any feedback from potential users and can adapt our approach if needed.
Advantages:
Disadvantages:
Advantages:
Disadvantages:
Advantages:
Disadvantages:
Initially there was a discussion of potentially defining alpha and beta
pre-release versions along with release candidate versions, nightly, and
development versions. The specific idea was to document versioning we could use
for longer-lived releases we want to make when not yet ready to call it a
release candidate.
Advantages:
0.1, this would provide a ready-made solution.Disadvantages: