about summary refs log tree commit diff
path: root/tvix/docs/lang-version.md

Nix language version history

The Nix language (“Nix”) has its own versioning mechanism independent from its most popular implementation (“C++ Nix”): builtins.langVersion. It has been increased whenever the language has changed syntactically or semantically in a way that would not be introspectable otherwise. In particular, this does not include addition (or removal) of builtins, as this can be introspected using standard attribute set operations.

Changes to builtins.langVersion are best found by viewing the git history of C++ Nix using git log -G 'mkInt\\(v, [0-9]\\)' for builtins.langVersion < 7. After that point git log -G 'v\\.mkInt\\([0-9]+\\)' should work. To reduce the amount of false positives, specify the version number you are interested in explicitly.

1

The first version of the Nix language is its state at the point when builtins.langVersion was added in 8b8ee53 which was first released as part of C++ Nix 1.2.

2

Nix version 2 changed the behavior of builtins.storePath: It would now try to substitute the given path if missing, instead of creating an evaluation failure. builtins.langVersion was increased in e36229d.

3

Nix version 3 changed the behavior of the == behavior. Strings would now be considered equal even if they had differing string context.

4

Nix version 4 added the float type to the language.

5

The increase of builtins.langVersion to 5 did not signify a language change, but added support for structured attributes to the Nix daemon. Eelco Dolstra writes as to what changed:

The structured attributes support. Unfortunately that's not so much a language change as a build.cc (i.e. daemon) change, but we don't really have a way to express that...

Probably builtins.nixVersion (which was added in version 1) should have been used instead.

6

Nix version 6 added support for comparing two lists.