Live data from Hacker News

Nix Language Primer

binaryphile.com

21–30 of 69 posts

Re: Nix Language Primer

#21
post #20
post #6

I've had the displeasure of being forced to use nix and to me it seems like an overengineered piece of garbage. I don't see why anyone should use this vs competitors

Why would anyone use it versus its competitors? Here's why: 1. You can uninstall a thing and it will no longer affect your computer. 2. Your environment will work the same way on your colleague's computer. 3. Your environment will work the same way years down the line. 4. Your environment will probably work the same way years down the line, even after you've applied security updates. If it doesn't, it will probably b…

[deleted]

Re: Nix Language Primer

#22
post #6

I've had the displeasure of being forced to use nix and to me it seems like an overengineered piece of garbage. I don't see why anyone should use this vs competitors

How were you forced to use Nix? I didn't know anyone was using Nix in a professional environment.

Cardano the cryptocurrency is written in Haskell and uses nix as it's package manager

Re: Nix Language Primer

#23
post #6

I've had the displeasure of being forced to use nix and to me it seems like an overengineered piece of garbage. I don't see why anyone should use this vs competitors

Overengineered, hah. Most UX issues could be chalked up to it not doing enough !

Exactly, let's make the package manager do 100000 things.

Re: Nix Language Primer

#24
post #20
post #6

I've had the displeasure of being forced to use nix and to me it seems like an overengineered piece of garbage. I don't see why anyone should use this vs competitors

Why would anyone use it versus its competitors? Here's why: 1. You can uninstall a thing and it will no longer affect your computer. 2. Your environment will work the same way on your colleague's computer. 3. Your environment will work the same way years down the line. 4. Your environment will probably work the same way years down the line, even after you've applied security updates. If it doesn't, it will probably b…

I don't care about those features, I just wanted to download the packages and it's dependencies and in the end it never did that.

Nix is probably good for many things, but it's not simple and to me it's trying to do too many things.

Re: Nix Language Primer

#25
post #24
post #20

Earlier quoted context omitted.

Why would anyone use it versus its competitors? Here's why: 1. You can uninstall a thing and it will no longer affect your computer. 2. Your environment will work the same way on your colleague's computer. 3. Your environment will work the same way years down the line. 4. Your environment will probably work the same way years down the line, even after you've applied security updates. If it doesn't, it will probably b…

I don't care about those features, I just wanted to download the packages and it's dependencies and in the end it never did that. Nix is probably good for many things, but it's not simple and to me it's trying to do too many things.

That is not what "overengineered garbage" means.

Re: Nix Language Primer

#26
post #24
post #20

Earlier quoted context omitted.

Why would anyone use it versus its competitors? Here's why: 1. You can uninstall a thing and it will no longer affect your computer. 2. Your environment will work the same way on your colleague's computer. 3. Your environment will work the same way years down the line. 4. Your environment will probably work the same way years down the line, even after you've applied security updates. If it doesn't, it will probably b…

I don't care about those features, I just wanted to download the packages and it's dependencies and in the end it never did that. Nix is probably good for many things, but it's not simple and to me it's trying to do too many things.

I'm using Nix to download packages and its dependencies to a cluster of 250 nodes around 10 times per week. And it always does that.

Re: Nix Language Primer

#27
post #3
post #2

Does anyone know the rationale for creating Nixlang? Guix's use of Scheme proves there isn't a novel feature unavailable elsewhere, so it seems like a lot of wasted effort to implement a language that will likely only ever be used for one suite of programs. (And tooling; though almost none exists now, making the choice even more expensive.) I've tried to find one, but "nix" is a difficult thing to google for given th…

I believe the motivation is that it eschews a lot of convenient crutches that would defeat the purpose of using nix (e.g. impurity) and adds a lot of convenient crutches that don't (e.g. a lot of implicit coercion for derivations).

Purity is a property of the functional methodology, not of the language. You don't need to use an effect-free language when operating in an environment that renders most effects void.

Re: Nix Language Primer

#28
post #19
post #13

Earlier quoted context omitted.

I like Scheme, but I think a lot of people actually wouldn’t want to write their packages and OS configuration files as S-expressions. Nix is an extremely simple language with quite familiar syntax, a kind of JSON with functions and string interpolation. Note also that Guix uses Scheme a lot more deeply than Nix uses the Nix language, in the sense that Nix uses e.g. shell scripts where Guix uses Scheme statements. Ac…

For me personally, as a person who's tried Nix, it's helpful that the Nix language is simple, self contained and easy to learn & grok quickly. I never learnt Scheme, and its use in Guix, though extremely interesting and appealing in theory, also feels notably overwhelming to me. That I'd have to learn a whole (presumably huge) R7RS or something, just to be able to use Guix. And then still have to learn the Guix "API"…

Disclaimer: as a Guix co-maintainer I'm totally biased.

We don't use R7RS in Guix. You need to know about the Scheme syntax, obviously (including keyword arguments), and a couple of common procedures like `string-append`, but aside from that you don't really need to know much about Scheme at all.

What comes in handy is the Guix DSL, which provides a convenient way to specify packages and download origins. Guix also has a bunch of utility procedures that are useful extensions to their Scheme counterparts, such as `mkdir-p` (which does what you think it does) or the `substitute*` form to substitute expressions in a file or list of files.

One important difference between Nix and Guix is that Guix does not glue shell snippets together, but eventually compiles to Guile builder scripts, so it's Scheme all the way down.

Re: Nix Language Primer

#29
post #4
post #2

Does anyone know the rationale for creating Nixlang? Guix's use of Scheme proves there isn't a novel feature unavailable elsewhere, so it seems like a lot of wasted effort to implement a language that will likely only ever be used for one suite of programs. (And tooling; though almost none exists now, making the choice even more expensive.) I've tried to find one, but "nix" is a difficult thing to google for given th…

The Nix thesis may give some insight: https://nixos.org/~eelco/pubs/phd-thesis.pdf Guix's use of Guile is fundamentally equivalent to the Nix package manager's use of the Nix language, but the approach Guix takes to organizing packages is very different. IMO, the Nix language approach is cleaner and more elegant when it comes to describing packages, but it's not clear whether that's worth the cost of using a domain-s…

In Guix there are first class package objects that have references to other first class packages. Together they form a lazily evaluated graph. At a lower level, package objects can be compiled into one or many derivations, which is where things start to look more similar to Nix again.

In Nix the idea of "functional package management" is more visible as there are no packages but functions with arguments that would result in a package once evaluated.

Re: Nix Language Primer

#30
post #5
post #2

Does anyone know the rationale for creating Nixlang? Guix's use of Scheme proves there isn't a novel feature unavailable elsewhere, so it seems like a lot of wasted effort to implement a language that will likely only ever be used for one suite of programs. (And tooling; though almost none exists now, making the choice even more expensive.) I've tried to find one, but "nix" is a difficult thing to google for given th…

I think one of the keys features is lazy evaluation. Nixpkgs is one giant expression that evaluates to the complete set of packages that it provides. But since only some the attributes of that set are evaluated in any given invocation, it's still efficient. That can be vertical (eg, a package and it's dependencies) or horizontal (eg, the names of all the packages). Guix shows that this isn't the only way to do it, bu…

Guix packages are also evaluated lazily. Package objects (values of the `` type) can have an arbitrary number of declared inputs, which are package objects as well. These are not evaluated eagerly, of course.

Lazy evaluation does not have to be a language feature. In the case of Guix's `` record, only some of the fields are delayed or thunked.

Post reply on HN