doc/manual/source/development/experimental-features.md
This section describes the notion of experimental features, and how it fits into the big picture of the development of Nix.
Experimental features are considered unstable, which means that they can be changed or removed at any time. Users must explicitly enable them by toggling the associated experimental feature flags. This allows accessing unstable functionality without unwittingly relying on it.
Experimental feature flags were first introduced in Nix 2.4. Before that, Nix did have experimental features, but they were not guarded by flags and were merely documented as unstable. This was a source of confusion and controversy.
A change in the Nix codebase should be guarded by an experimental feature flag if it is considered likely to be reverted or adapted in a backwards-incompatible manner after gathering more experience with it in practice.
Examples:
Experimental features have to be treated on a case-by-case basis. However, the standard workflow for an experimental feature is as follows:
The following diagram illustrates the process:
.------.
| idea |
'------'
|
discussion, design, implementation
|
| .-------.
| | |
v v |
.--------------. review
| pull request | |
'--------------' |
| ^ | |
| | '-------'
.---' '----.
| |
merge user feedback,
| (breaking) changes
| |
'---. .----'
| |
v |
+--------------+
.---| experimental |----.
| +--------------+ |
| |
decision to stabilise decision against
| keeping the feature
| |
v v
+--------+ +---------+
| stable | | removed |
+--------+ +---------+
Experimental features and RFCs both allow approaching substantial changes while minimizing the risk. However they serve different purposes:
This means that experimental features and RFCs are orthogonal mechanisms, and can be used independently or together as needed.
{{#include ./experimental-feature-descriptions.md}}