Hacker News new | ask | show | jobs
by civodul 3281 days ago
The problem with Nix in terms of typing is that it relies a lot on key/value dictionaries ("attribute sets" in Nix parlance). These data structures are dynamic in nature. All a static type checker can say is "yeah this is an attribute set". In addition, Nix does not offer a way to define new disjoint data types.

Conversely in Guix most of the data structures are disjoint record types. Scheme (the implementation language of Guix) is dynamically-typed, but there are sanity checks we can do on records both at macro-expansion time and at run time, such as checking whether all the required fields are defined and no extra field is passed. Concretely, this means that users get clear syntax errors or run-time type errors.

Nix and Scheme are both dynamically typed, but they have a different typing story.

Disclaimer: Guix hacker here.