Hacker News new | ask | show | jobs
by mlevental 2557 days ago
how does nix eliminate compile times???
2 comments

It doesn’t eliminate them entirely; it’s just very smart about allowing packages to be built exactly once, and having a deterministic output such that it can be determined before a package is built whether a prebuilt version is available. This prebuilt version can either be the result of a previous build on your machine, or on another machine served from a repository.

Of course, there are times when you need to compile yourself, but most slow-to-compile packages, such as Aeson, Lens, Servant or the aforementioned Parsec, and many more on top of that have prebuilt binaries available when built from community snapshots (nixpkgs/nixos). You can even pin your package definitions to guarantee that you’re building something that will have prebuilt versions available. New project build is usually less than a minute or two, sometimes substantially so (anecdotally). Again, not always, but usually.

Looks like it offers precompiled packages:

> Nix lets you download precompiled Hackage packages whereas stack compiles them on your computer the first time you depend on them

Source: https://github.com/Gabriel439/haskell-nix#background