3 ms·
As someone who's only recently made the switch from OpenBSD to NixOS due to work needing Linux, I have some thoughts on this. OpenBSD is very easy to reason abo
by icy 4y ago
As someone who's only recently made the switch from OpenBSD to NixOS due to work needing Linux, I have some thoughts on this. OpenBSD is very easy to reason about -- not too many things going on, and every little thing is documented. The system fits in your head and doesn't overwhelm you; it is predictable and sensible.
NixOS on the other hand: while I really like the idea of declaratively managing your entire system, the whole functional programming schtick isn't for me. I cannot for the life of me understand half the stuff I read (the Nix language, that is). I still don't see why all this couldn't have been written in say, Lua for example. Nix (and NixOS), is overwhelming.
That said, it's the least-shit of all Linux distros because it brings about the cohesion that others lack. I will continue to use it, at least for now.
- meain 4y agoI've heard some good things about Guix on the language front. It is similar to nix but uses guile scheme as the configuration language. https://guix.gnu.org/ https://guix.gnu.org/
- xyzzy_plugh 4y ago> the whole functional programming schtick isn't for me. I cannot for the life of me understand half the stuff I read (the Nix language, that is). I still don't see why all this couldn't have been written in say, Lua for example. Nix (and NixOS), is overwhelming. It's because you're still thinking about this imperatively, when you should be thinking declaratively. I was in the same boat as you, but everything has recently begun to gel and it's much easier to read Nix configs. The language is definitely intimidating but once I wrote a few small derivations for my own use, everything became clear almost immediately, much to my surprise. Try to do everything as declarative as possible (use flakes) and you'll have a considerably more consistent experience.
- rewgs 4y agoWould you mind giving me an example of something that’s declarative vs imperative? I see this distinction made all the time and for the life of me I still don’t understand it. Or rather, I’ve never seen “declarative” code that I’ve liked. I watched a YouTube video once wherein two bits of code achieved the same thing, but one was imperative and the other declarative. I preferred the “imperative” code every time because I could actually read it, see what was going on. The “declarative” code seemed like it was obfuscating something or engaging in a bit too much magic for my tastes. All the cool kids prefer declarative though, so I’m wondering what I’m missing.
- iswkq 4y agoit is about telling what you want instead of how to do ("computer thinking"). so let's say you want all numbers from 10 to 14 excluding 13, 15, 19 and 23. In haskell you do `[x | x <- [10..24], x /= 13, x /= 15, x /= 19, x /= 23]`, which is declarative. In imperative programming you generally would need to do control flow like a for loop. So declarative programming is way more expressive, as in functional programming like haskell it borrows many mathematical notations. I find declarative programming like functional better for higher level programming, while Torvalds for example likes C for Linux development because it is closer to how computers work (while providing the needed abstraction than programming in assembly for example). but i don't think the argument for it really makes any sense for OP's comment. As an user or even packager you hardly use actual functional concepts. You're mostly dealing with a JSON with some functions for declaring the system, not some crazy Haskell shit. It is just that it takes time to learn new stuff, and stuff that have concepts you're unfamiliar with takes a bit longer. And it is true that the curly braces, function arguments, and some other stuff can look kind hard to decipher, but in general it's a familiarity thing.
- iswkq 4y agofor how much time you've used it? what have you done and explored so far? did you package something for example?