I think you will be quite interested by how Rust handle that.
They have "feature gates" that are annotations (in the source) to enable specific features. They also have a notion of stability integrated into their documentation.

Le 08/10/2014 18:45, Yotam Barnoy a écrit :
No, I'm not suggesting turning features on or off as in haskell. This requires no actual programmatic changes to the code. It's just a conceptual labeling of features, indicating their level of stability. It means that when introducing new features, certain parts of the language must be seen as static (or close to static) while others are more malleable or even very malleable. 

The ocaml devs can introduce features more liberally, without worrying about future implications as much. If an alpha feature doesn't survive alpha, it'll be cut/modified eventually. They can rely on user feedback to gauge whether a feature is really worth solidifying into the core language. Perhaps there could even be another level: experimental features, which aren't even guaranteed to play nice with alpha or other experimental features, but allow experimenting with ideas in the wild.

It also sets the expectations of the users: if you want to make sure your code will compile in 5 years' time, use only stable features. If you're ok with features that have been around for a while but may change a little, use beta features. If you're not afraid to mess with the latest stuff, you can use alpha level features.



On Wed, Oct 8, 2014 at 12:35 PM, Milan Stanojević <milanst@gmail.com> wrote:
I'm not sure that current compiler architecture can easily support
your suggestion.
It does sound nice but I'm afraid it would lead to a combinatorial
explosion in the code, handling different cases where an extension
might be on or off.
A lot of recent ocaml language extension have subtle interactions with
each other that can easily lead to bugs, even unsoundness.


> While I'm not suggesting playing it fast and loose like haskell, perhaps it
> makes sense to have stages of integration into the language. I suggest 3
> stages, borrowing the terminology from software release cycles (but
> perfectly willing to use other terminology or number of stages). An alpha
> feature is one that was just introduced, and is still likely to change in
> future versions. An alpha feature that has survived enough ocaml version
> iterations and seems useful and complete can move into beta level. I foresee
> features spending a long time in the beta state, which also guarantees the
> users a further level of stability over alpha features.

So features then turned on and off by level? E.g. all alpha features
or on or none?