Live data from Hacker News

What is Nix and why you should try it

yakking.branchable.com

71–80 of 201 posts

Re: What is Nix and why you should try it

#71

Earlier quoted context omitted.

these functions' documentation is either buried in a long manual This is a problem with lots of feature-rich software, even with meticulously-documented APIs. What we need is reverse-indexed documentation. That is, an extensive API reference is only useful for someone who already knows what functions are in the API and just needs to remember how to use them. But even the most thorough API reference does nothing to pr…

One great approach is the Hoogle search engine for Haskell [1]. The idea with that is that you search by type, instead of name. So if you were looking for a function to take a item, and return a list with n copies of that item, you would search for `a -> Int -> [a]`, which would give you back replicate. Looks like the Nix expression language is untyped, so this wouldn't work directly, but maybe adding a rough type si…

Some Smalltalks (Squeak and Pharo) have a wonderful tool called a "Method Finder".

The way it works is you write a sequence of arguments and an expected result, and it suggests a method to call.

For example, I just now tried it, entering

  3. 4. 7
in the input. It suggested the following methods:

  3 + 4 --> 7
  3 bitOr: 4 --> 7
  3 bitXor: 4 --> 7
Clicking on any of these opens a browser on the class and method concerned.

Another example: input of

  'hello world'. #('hello' 'world')
yielded the single suggestion

  'hello world' substrings --> #('hello' 'world')
Another:

  '  abc  '. 'abc'
yields

  '  abc  ' asLegalSelector --> 'abc'
  '  abc  ' withBlanksTrimmed --> 'abc'
;;--

It's a total hack, of course, but none the less effective or useful for that.

It has a list of methods marked "safe to experiment with", and simply tries them out.

It gets a big boost from being able to evaluate the receiver (the first in the input list) to a concrete object, and then only consider methods on that object's class.

Re: What is Nix and why you should try it

#72
post #19

I can vouch for the immense improvement Nix has made to my software development process. I use NixOS on my desktop and laptop. At the OS-level, it gets a lot of things right: reproducible, immutable system configs; lightweight containers; devops with declarative configs. At a software project level, nix-shell is an indispensible tool. Compilers and interpreters aren't even part of my system-wide config; instead each…

By reading your comment and a little bit of the package declarations in some nix packages, it seems like the software package system of nix is very similar to rez.

Rez ( https://github.com/nerdvegas/rez ) is used by some visual effects companies (including mine) to manage software packages.

It allows us to have great flexibility in the mix & match of software versions and runtime environments.

Re: What is Nix and why you should try it

#73
post #62

Just a heads-up in case anyone is confused as I was: Nix is not 100% bit-for-bit deterministic/reproducible yet, though they do deliver functional equivalence.

There are efforts to get deterministic builds in NixOS, but it comes with downsides like very high build times.

Re: What is Nix and why you should try it

#75
Is there a way to install nix into home folder (suppose I don't have sudo on server). I spend some time recently trying to setup nix in such environment and failed. I ended up compiling recent versions of neovim and tmux myself.

Re: What is Nix and why you should try it

#76
post #12
post #8

Earlier quoted context omitted.

Primarily from my perspective... the entire package repo acts as one enormous program. Which is both good and bad. Its not that easy imo to create ad hoc packages or packaging scripts

I strongly disagree. Creating a Nix package is significantly easier than creating, e.g.: an Arch package, from my experience. packageOverrides is really nice too.

Try packaging a postgres extension :-)

Re: What is Nix and why you should try it

#77
post #57
post #19

I can vouch for the immense improvement Nix has made to my software development process. I use NixOS on my desktop and laptop. At the OS-level, it gets a lot of things right: reproducible, immutable system configs; lightweight containers; devops with declarative configs. At a software project level, nix-shell is an indispensible tool. Compilers and interpreters aren't even part of my system-wide config; instead each…

Naive question: Isn't all that also true for Guix? If so, why do your prefer Nix over Guix?

Why shouldn't one prefer the original over some rando's weakly motivated, niche NIH rehash, unless you're already victim to lisp-induced Stockholm syndrome?

Re: What is Nix and why you should try it

#78
post #30

I'm gonna need a better reason to switch distros than that. I do think that is an improvement that needs to be adopted in the OS. But, I mean, it's not that much of a improvement over containers. I don't feel like it gives me, the user, that much more power over the OS and would be a feature that I would only use very rarely.

Have you tried Habitat.sh yet? I has similar goals to NixOS without needing to give up the OS of your choice.

Re: What is Nix and why you should try it

#79
post #62

Just a heads-up in case anyone is confused as I was: Nix is not 100% bit-for-bit deterministic/reproducible yet, though they do deliver functional equivalence.

There are efforts to get deterministic builds in NixOS, but it comes with downsides like very high build times.

Can you elaborate? I always thought deterministic builds would enable faster builds (because it would basically allow for downloading and verification of binaries).

Re: What is Nix and why you should try it

#80
post #57

Earlier quoted context omitted.

Naive question: Isn't all that also true for Guix? If so, why do your prefer Nix over Guix?

Not the grandparent, but from what i can see, grandparent compares Nix with traditional package managers like dpkg or RPM, rather than Guix. I cannot answer your question, but I think Nix has (for some reason) a lot more publicity than Guix at the moment.

Guix is derived from Nix, so that might be why.
Post reply on HN