Live data from Hacker News

Nix: Taming Unix with Functional Programming

tweag.io

61–70 of 205 posts

Re: Nix: Taming Unix with Functional Programming

#61
post #40
post #21

Earlier quoted context omitted.

> Nix needs a new porcelain interface for it's CLIs. It already has one with the 'nix' command, it just needs to be manually enabled under 'experimental-features', but once done there is basically no reason to ever touch any of the old commands.

> it just needs to be manually enabled under 'experimental-features' Same with flakes. My impression is that Nix is either on the cusp of a major paradigm and usability change, or the status quo will be forever in a state of having "wrong defaults."

I think the really crazy default is that flakes by default will not include git submodules, you need to pass a special flag to enable it, which is undocumented and have to dig through github issues: https://github.com/NixOS/nix/issues/4423

Re: Nix: Taming Unix with Functional Programming

#62
Nix is running face-first into complexities of build and package managers. As an observer it looks like Python's package ecosystem in particular is a giant mess. This affects Nix disproportionately because Nix actually integrates all package updates into one channel which nobody else anywhere does (and I guess package authors often don't care to fix), and it's even worse because a lot of projects use python as a build dependency (?!) which then cascades these issues even farther.

I've been following this thread [1] about the issue which has valid interested parties including users, package authors, and nix package maintainers, and contains various proposals to solve or alleviate the problems.

[1]: https://discourse.nixos.org/t/nixpkgss-current-development-w...

Re: Nix: Taming Unix with Functional Programming

#63

Nix needs a new porcelain interface for it's CLIs. Moreover, this post sums up one of my biggest issues stopping me from trying Nix for real again: https://ianthehenry.com/posts/how-to-learn-nix/ambiguous-pac... Finally, needing to rewrite everything in Nix is nice for poorly written configurations or undocumented packages in general, but seems redundant for well maintained software. Has anyone else come up with a sa…

I think nix probably needs a more beginner friendly documentation as well, by beginner friendly I mean Linux beginners. Beginners will not read through nix pills (assuming they can understand it) before trying nix, they will just give up. And there are a lot of Linux users who don't have much technical knowledge about how binaries are being linked, etc.

I think the ecosystem is now mature enough for beginner users to ignore the detailed packaging issues, just rely on home manager and nixos options for most of the setup. And I think it is should be possible to create something like a GUI for home manager, to lower the entry barrier. If people are looking for a distribution rather than a build system, we shouldn't be teaching them how to use nix as a build system, we should show them some config that just works.

Re: Nix: Taming Unix with Functional Programming

#64
post #33

Earlier quoted context omitted.

An unfortunate huge one is any way to interact w/ Intel Optimus. I can't be the only dev that wants to eat my gpu cake and have my battery life optimization cake too. Bumblebee and optimus-manager both solve this in the aur.

Bumblebee is well-supported in NixOS. My last mobile NVIDIA hardware has died, but I used it Bumblebee on NixOS for years. https://search.nixos.org/options?channel=22.05&from=0&size=5... https://search.nixos.org/options?channel=22.05&show=hardware...

Oh, this is great info. Thank you. I use optimus-manager and it's 100% not, so I thought I was just SoL.

Re: Nix: Taming Unix with Functional Programming

#65

Nix is running face-first into complexities of build and package managers. As an observer it looks like Python's package ecosystem in particular is a giant mess . This affects Nix disproportionately because Nix actually integrates all package updates into one channel which nobody else anywhere does (and I guess package authors often don't care to fix), and it's even worse because a lot of projects use python as a bui…

Yeah. This is covering stuff you know if you've read that thread, but:

Putting all Python libs into a single channel is something Nixpkgs does because Python can't handle different versions of the same library in a single process. The Python libs that are used in actual applications in NixOS, then, need to be compatible or they might cause weird issues when a new or existing package tries to leverage them at the same time. Other distros do run into this but it might be worse in Nix. (Some (all?) C libs have this same issue, but they don't have rampant integration problems from version to version like the Python ecosystem does, so having just one copy of them is fine.)

And yeah, Python developers seem wary of the kind of vendorization that would fix this, and some Python package authors are very hostile about integration issues that Linux distros are more likely to hit than developers of individual downstream applications are. (I guess they don't feel like distro integrators are truly 'using their code' in the way that application or library developers would be, and those integration issues can be a lot of work to figure out for what feels like some 'fake user's' configuration problem.)

Python packaging has been an incredible mess for many, many years. I don't think the community's processes and institutions have the means to meaningfully fix it so that downstream consumers of Python packaging infrastructure don't have to use a big pile of hacks to successfully package Python applications.

Distros will probably see another language replace Python for internal tooling and sysadmin applications before they see Python packaging unified around something that behaves deterministically, works offline, lets programs reason about the dependencies of packages that are not present/installed/built, pins versions with cryptographic hashes by default, disallows arbitrary scripts at install time, sanely describes dependencies on native libraries, etc.

PS: This is not a knock on Python. The Python community faces some really tough institutional/governance/adoption problems because:

  - the language is mature and the ecosystem has a lot of valuable code in it, already packaged in various ways
  - the language was born without a modern package management story, because it's very old!
  - big community-wide changes are democratically governed and there are a lot of stakeholders who are bound to have opinions
Consensus will be really hard to build and legacy packaging processes will stick around for a long time. And some changes that could really help, like in-process changes to library loading behavior, are likely to be seen (perhaps correctly!) as too radical/disruptive to be in the best interest of the majority of the existing community.

Re: Nix: Taming Unix with Functional Programming

#66
post #59
post #56

Man, there’s a lot of negative comments here. Just to add a different experience: my company loves Nix, it makes it really easy to integrate new tools into the dev/build environment without needing to document which packages, configuration, … a developer needs to apply to their machine manually. There’s nothing like it, really.

I dont think anyone is being negative at least not the top level comments i read. I like nix but i gave it a test run at my company and no one could figure out how to make any change that wasn’t a copy and paste of what i had done. The docs don’t help much unless you really go diving into them and most people who just want the software to run don’t want to spend the time learning it. I don’t blame them. This is a ver…

Same here. Using Nix and Nixos for years, I have prepared nix-shell and packaging files for our internal tools and committed to internal gitlab. No one ever touched it even after multiple presentations from me. No way to find your way out, especially if you don't have functional programming background.

Re: Nix: Taming Unix with Functional Programming

#67
post #14

Earlier quoted context omitted.

I am not sure, but it is possible that R want to be its own package manager which interferes with Guix? A similar problem seems to appear in Python, where there on Distributions like Debian there is kind of a struggle which package manager - the system-defined packages, or the user-defined ones like pip - have the last word. I have used Guix a bit with Common Lisp libraries, and that works like a charm. I also found…

R does have it's own package manager but I was explicitly not using it because I read there could be issues, instead only installing packages through Guix. It was mainly a problem compiling things within R as if the order of how gcc-toolchain and the R package were setup it straight up wouldn't work. With later versions it just broke entirely and I never managed to fix it.

Despite R being the most commonly packaged software on Guix and it being a GNU project and a "common lisp for dummies" lispy language which is used by millions of students, researchers and data scientists, the developers seem to have a noticeable animosity towards it (although not as much as the "snake people"). This makes me sad, as R users would be the first to sign up for what Guix offers if it worked well and the RcppGuile R package could be used as a template for bridging the gap between the spartan scheme infrastructure and the extremely rich and beginner friendly R infrastructure. I feel like this could also help motivate the Guix developers to improve the documentation and guile porcelain interfaces so they could be used directly instead of the copious bash code they all seem to relish writing.

Re: Nix: Taming Unix with Functional Programming

#68
post #33

Earlier quoted context omitted.

Bumblebee is well-supported in NixOS. My last mobile NVIDIA hardware has died, but I used it Bumblebee on NixOS for years. https://search.nixos.org/options?channel=22.05&from=0&size=5... https://search.nixos.org/options?channel=22.05&show=hardware...

Oh, this is great info. Thank you. I use optimus-manager and it's 100% not, so I thought I was just SoL.

It'll probably still be a bit of a pain to work out. I hate getting NVIDIA Optimus stuff working on a laptop for the first time, lol

You might want to consult the unofficial wiki: https://nixos.wiki/wiki/Nvidia

(You probably want PRIME in offload mode rather than Bumblebee, which wasn't available when I set up my old NVIDIA system.)

Re: Nix: Taming Unix with Functional Programming

#69
post #56

Man, there’s a lot of negative comments here. Just to add a different experience: my company loves Nix, it makes it really easy to integrate new tools into the dev/build environment without needing to document which packages, configuration, … a developer needs to apply to their machine manually. There’s nothing like it, really.

There are many things like it. For example, managed operating environments where the user doesn't need to do anything (and actually can't do anything). Or disposable environments like VMs and containers.

Sure, it's not the same as massaging a special pet operating system over and over, but most people that need to produce software hopped off of that bandwagon years ago.

I get that companies that do functional programming and linux and linux on the desktop exist, but I have yet to find any company that does that at scale, at a good profit, versus competition. That's not to say that "therefore, Nix is bad", it's just that the problem isn't a technical one that nix suddenly fixes. It seems to be only a problem if you're stuck in yum/apt all day and need to get a fix to get out of that.

Re: Nix: Taming Unix with Functional Programming

#70

Earlier quoted context omitted.

For x86, the package availability is almost unparalleled. NixOS also has tools and options which are not all pure and declarative, they're just not considered, "the way." I find NixOS to have a bit of a high learning curve, but worth it for the power and reproducibility.

> For x86, the package availability is almost unparalleled. https://repology.org/repositories/statistics/total In terms of total number of packages, nixpkgs unstable is at 72k, while AUR is at 68k. I'd bet there are many caveats, though.

I'm not sure what point you're trying to make.

AUR is a supplementary set of packages, and it looks like you're comparing it to the total number that Nix supports.

Wouldn't a more fair comparison would be official Arch packages + AUR to nixpkgs?

Post reply on HN