TVL's blog

Tvix: We are rewriting Nix

Evaluating the Nix programming language, used by the Nix package manager, is currently very slow. This becomes apparent in all projects written in Nix that are not just simple package definitions, for example:

Whichever project you pick, they all suffer from issues with the language implementation. At TVL, it takes us close to a minute to create the CI instructions for our monorepo at the moment - despite it being a plain Nix evaluation. Running our Nix-native build systems for Go and Common Lisp takes much more time than we would like.

Some time last year a few of us got together and started investigating ways to modernise the current architecture of Nix and figure out how to improve the speed of some of the components. We created over 250 commits in our fork of the Nix 2.3 codebase at the time, tried performance experiments aimed at improving the current evaluator and fought gnarly bugs.

After a while we realised that we were treading water: Some of our ideas are too architecturally divergent from Nix to be done on top of the existing codebase, and the memory model of Nix causes significant headaches when trying to do any kind of larger change.

We needed an alternative approach and started brainstorming on a bent whiteboard in a small flat in Hurghada, Egypt.

flokli & tazjin brainstorming

Half a year later we are now ready to announce our new project: Tvix, a re-imagined Nix with full nixpkgs compatibility. Tvix is generously funded by NLNet (thanks!) and we are ready to start implementing it.

The Tvix architecture is designed to be modular: It should be possible to write an evaluator that plugs in the Guile language (for compatibility with GNU Guix), to use arbitrary builders, and to replace the store implementation.

Tvix has these high-level goals:

adisbladis & tazjin brainstorming

Tvix is not intended to replace Nix, instead we want to improve the ecosystem by offering an alternative, fast and reliable implementation for Nix features that are in use today.

As things ramp up we will be posting more information on this blog, for now you can keep an eye on //tvix in the TVL monorepo and subscribe to our feed.

Stay tuned!

PS: TVL is international, but a lot of the development will take place in our office in Moscow. Say hi if you're around and interested!