5 ms·
I agree with all the points in this post. And, I love NixOS. It's really special and very different than the other Linux I've used for 20 years. I have been c
by xrd 4y ago
I agree with all the points in this post.
And, I love NixOS. It's really special and very different than the other Linux I've used for 20 years.
I have been curious to try Guix at some point. Does anyone know if there is a good comparison write-up?
Also, can anyone speculate why the community has had such a hard time documenting this incredible technology? There are great posts like this from Xe: https://xeiaso.net/ https://xeiaso.net/ but not generally getting started guides that are up to date. Why is this so hard to do? I mean, I'm not doing it because I personally feel like everything I do to get something working on Nix is a quasi-hack and not the standard and most up-to-date way to do it, so I'm hesitant to share. But, surely there are experts that like to write. Is this a problem with a simple technology solution (choose a better documentation tool)?
- Manuel_D 4y agoI think the issue is that there's just so much to document. I worked my way through the Nix pills, and understood the language and philosophy. But then doing anything productive with it is just way bigger than I can get my head around. It's like the joke about drawing an owl: https://i.imgur.com/rCr9A.png https://i.imgur.com/rCr9A.png
- anon291 4y agoRealistically, the nix community is made up of a lot of functional programmers. I realize the nix language seems confusing to many, but to fp programmers, it's intuitive and there's not a whole lot to say about it.
- masklinn 4y agoThe main problem of nix is not even the nix language, though I've heard little good around its error handling and debugging. My admittedly shallow understanding is also that it doesn't matter that much because most of your time will be spent in the sprawling mess of nixpkgs. > it's intuitive The naming is very odd (e.g. why "sets" for dicts / records), and then it manages to make the language incompatible with itself by having attribute sets for values and a completely different syntax for attribute set parameters, no doubt because the language was ambiguous due to the lack of function prefix (also makes curried functions awkward). Like, there's nothing hard to it, but the entire language feels awkward for no reason. Like "?" meaning "default value" in parameters but "has attribute" for navigation (where "or" is "default value"). > I realize the nix language seems confusing to many, but to fp programmers, it's intuitive and there's not a whole lot to say about it. XSLT is also a functional language. That doesn't make it not-awful.
- anon291 4y ago> The naming is very odd (e.g. why "sets" for dicts / records), and then it manages to make the language incompatible with itself by having attribute sets for values and a completely different syntax for attribute set parameters, no doubt because the language was ambiguous due to the lack of function prefix (also makes curried functions awkward). It's not sets... It's attrsets, and the naming of the construct doesn't matter. I'm not sure I called them anything until I looked it up just now. As for syntax... I'm not sure what you're referring to. Pattern syntax and construction syntax are different in every functional language I know. > XSLT is also a functional language. That doesn't make it not-awful. You're thinking of XQuery I think Nix broadly borrows exactly everything from the lambda calculus, with no change in terminology. It introduces records, which is kind of necessary for any serious programming. It adopts standard conventions for records (curly braces and an equal sign). The only 'surprising' bit of syntax is the lambda construct, but this is such a minor thing it's almost silly to complain about it. I honestly don't understand what is surprising about the nix language. Nixpkgs... sure I can see that, and I actually agree that types would be nice. Or at least interfaces. But the nix language as a whole is pretty straightforward.
- masklinn 4y ago> It's not sets... It's attrsets You may want to tell, er, the official website? https://nixos.org/manual/nix/stable/language/index.html https://nixos.org/manual/nix/stable/language/index.html > { x = 1; y = 2; } A set with attributes named x and y > and the naming of the construct doesn't matter. It absolutely matters when you're trying to learn the language and the naming of concepts is nonsensical. > Pattern syntax and construction syntax are different in every functional language I know. So you don't know Haskell? -- construction example = Person { name = "John Doe", admin = True } -- pattern render Person { name = name, admin = admin } = name ++ suffix where suffix = if admin then " - Admin" else "" or OCaml? (* construction *) let initial_state = { lcd=0; lka=Equals; loa=Equals; vpr=0 } ;; (* pattern *) match s with | { lcd = a; vpr = d; _ } -> (* Expression *) or Rust? // construction let p = Point { x: 0, y: 7 }; // pattern let Point { x: a, y: b } = p; All three have punning (as an extension for Haskell) so you can skip the explicit rebinding, but that's not what Nix does, as far as I can tell it doesn't have punning on the construction side, doesn't have full syntax on the pattern side, and the syntaxes are just similar enough to be annoying: # construction { x = 1; y = 2; } # pattern { x, y }: x + y > You're thinking of XQuery I think No, I am not. > I honestly don't understand what is surprising about the nix language. I can only assume that's Stockholm syndrome given I literally just went through https://nixos.org/manual/nix/stable/language/index.html https://nixos.org/manual/nix/stable/language/index.html and found the inconsistencies listed above, also that @ patterns can go on either side (why?), or the existence of "with" (though I guess in a functional and pure language it's not as bad as it is in good ol javascript with which it shares this great feature). And it's not that it's "surprising", it's just that it's... sloppy. Sub-par. And definitely not "intuitive". Even less so when a pair of single quotes is equivalent to a double quote (except not), rather than either an empty string (or at least something string-like), or an error. To say nothing of the escaping scheme inside those string literals.
- pca006132 4y agoPerhaps because there isn't really a starting point for this? Different people use nix for different things, perhaps a bit differently (e.g. whether they use flakes, home-manager, what channels do they follow). Each language has their own way of building packages, and different 'framework' in nix to build for them (usually about how to pull the dependencies in a reproducible way). And there are things that readers are expected to know such as basic shell scripts, paths, etc.
- uncletaco 4y agoI don't think Xe's posts are all that great. The stuff they complain about are a result of not knowing what Doom Emacs does for them (because Henrik Lissner uses NixOS personally and has added a lot of convenient functionality to the nix module).
- uncletaco 4y agoIt's too late to edit but I'm speaking specifically about their guix/gnu posts. Otherwise they're fantastic to read.