Description
Currently Scala 3 has a concept of Experimental Feature
- a feature that is introduced to standard library / language syntax but is prone to changes, might be unstable, break binary compatibility or be even removed in the future.
Currently our process does not describe well the stabilization period of currently experimental features. Both instability and lack of proper information might discourage users from trying out the new features which might reduce amount of feedback and can lead to lead maintaining flowed designs.
During the last Scala Core team meeting it was proposed to introduce a Preview Features
as a interim stage between experimental and stable features. These might be treated as an early access to fully implemented, but not yet fully stabilized features that might introduce minor changes.
Stage | Name | Description | Usage |
---|---|---|---|
Stage 0 | Early experimental / PoC | Feature is implemented behind a flag, awaits approval from SIP committee Highly prone to changes. Might be removed or redesigned at any moment |
Requires explicit -experimental + -experimental.feature flags. Might requiring building compiler from a separate branch before usage. |
Stage 1 | Experimental | Feature has been accepted by the SIP committee but is still under active development. No source/binary guarantees. Might change, be removed or redesigned based on feedback from users. Not recommended to be used on daily usage by users, but encouraged to try out |
Requires explicit -experimental + -experimental.feature flags |
Stage 2 | Preview | Feature has been fully implemented and would become stable after evaluation period. It is not going to be removed at any later point. Does not guarantee binary compatibility, but it is unlikely to introduce breaking changes. It can be adopted (in limited scope) to the needs of the users based on feedback gathered during evaluation period. It can be used by users that don't require binary compatibility e.g. applications but not libraries. |
Enabled using --preview flag (optionally also --preview.feature flag) |
Stage 3 | Stable | Feature has been proven to not change during evaluation period. It becomes a stable feature and does guarantee source/binary compatibity in all the future versions | Enabled by default |
All of the implemented features should follow the staging through experimental
-> preview
-> stable
staging. Advancement between the 2 stages should happen in the first release of next minor release of Scala.
The compiler should track usage of preview features using mechanism similar to the one used by experimental
features. It might be considered to either enable preview features selectively or to allow usage of all preview features when compiling under --preview
mode.