4 ms·
How does the Nix configuration language compare to Guile?
by pmoriarty 4y ago
How does the Nix configuration language compare to Guile?
- dudeinsf 4y agoSo I had to write a few functions in both. With Guile, very straight forward using Lisp's powerful "data-as-code, code-as-data" paradigms (the ` operator). A joy really, and writing code just felt like writing Lisp, where one gets to reason about small scope within simple functions. With Nix, I had to learn how the whole thing works before I could even get started. Nix is not a "normal" language, you're essentially just writing chunks of configuration, organized across different files, building up to one big derivation (as Nix calls it) that gets interpreted. Nix has syntax on how it expects the configuration to look and what configuration it expects to be defined. You can learn the syntax but it's still confusing (to me) as to what configuration is always expected. And errors can still be cryptic.
- dieracdelta 4y agoFWIW debugging nix expressions is about to get much easier. Master branch of the nix compiler now has a debugger. Hopefully this will be stabilized in the next release cycle.
- breakds 4y agoAs a former professional Lisp programmer, I think the Nix language was pretty good. Not the easiest to pick up but I like writing it very much once getting used to it.
- soraminazuki 4y agoThe Nix language is basically JSON with functions, similar to Jsonnet. Despite the language being small, it makes it surprisingly easy to deal with large scale configuration. The Nixpkgs repository [1], which contains "over 80,000 software packages," consists of a single large Nix expression spanning thousands of files and somehow manages to be comprehensible. [1]: https://github.com/NixOS/nixpkgs https://github.com/NixOS/nixpkgs