-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce concept of Preview Features as a feature stabilization period #22044
Comments
Java previews probably don't apply to Scala development process well. The Java previews (and incubator and experimental features) are controlled not only on compile time, but also on run time. All preview features are enabled using single switch Scala doesn't control the run time class loading, so it can't produce same errors as Java preview or incubator features. Scala could emulate some of the controlling functionality, by checking for flags enablement in static class initializers and conditionally throwing an exception. P.S. I'm writing from memory and haven't spent a lot of time for fact-checking myself, but there shouldn't be significant inaccuracies. Note that the preview periods in Java are sometimes extended without any user-facing change in meantime, e.g.
|
This would be a very welcome change! I hope it can be accompanied by a living documentation page with a table like this:
for all the experimental features to provide minimal versions where it's available/stabilised. Not necessarily a commitment, but a good view of where the language is at. I struggle to fill the rest of the table as I have no idea where to get information on any of the cells in it. I also added safe initialisation as it is not exposed as experimental feature, but the documentation marks it as experimental. |
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.Highly prone to changes. Might be removed or redesigned at any moment
-experimental
+-experimental.feature
flags.Might requiring building compiler from a separate branch before usage.
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
-experimental
+-experimental.feature
flagsIt 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.
--preview
flag (optionally also--preview.feature
flag)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.The text was updated successfully, but these errors were encountered: