Hacker News new | ask | show | jobs
by bumeye 5149 days ago
There's also referential transparency.

For programming languages, that means the result of a function is dependent on it's inputs ONLY. The function can not use any unspecified inputs like system time or an internal state.

In Nix, that means a package can only depend on dependencies which are specified beforehand. It's nearly impossible to use libraries or binaries which you did not specify.

That behavior makes it easier to reason about your whole system, like determining which packages are unused. This is similar to the advantages of referential transparency in functional languages

1 comments

> that means the result of a function is dependent on it's inputs ONLY

Not quite, it means that a function call can be replaced by its value (A function can depend only on its inputs, yet write to a global variable, for example).