Live data from Hacker News

Typing Nix

tweag.io

101–110 of 128 posts

Re: Typing Nix

#101
post #86

Earlier quoted context omitted.

How so?

Inserting a new element with comma-first changes 2 lines: - { old-one + { new-one + , old-one While trailing commas allow you to insert an element anywhere with just one line addition. This doesn't break anything, but it makes looking at "git blame" so much easier.

This is only true if you insert at the head. And it's not really leading comma placement but the choice to put the first element in the line with the brace that is the culprit, though both are typical of comma-first.

Re: Typing Nix

#102
post #21

How does Nix compare with conda[0] ? I could not find any useful resource, in my team we were hesitating between the two, for packages management ; finally we went for conda because it (seems)is better documented and package description is easier to write for newbies. And also we are a Python shop, so other devs felt more comfortable with conda. Personally I prefer Nix, though, and I wanted to advocate for it but the…

I wrote this document: http://catern.com/posts/deps.html which briefly compares both Conda and Nix among other things. (warning: it's very pro-Nix :) )

That is excellent, thanks. Double for mentioning Docker.

Re: Typing Nix

#103
post #11

Earlier quoted context omitted.

I think that all the efforts to fix or re-implement the Nix language have vindicated Ludovic, the Guix maintainer, who chose an existing general-purpose language instead.

Except GUIX is more of a political project and part of the GNU "stack". It's a noble goal and I think it's great they're doing it. (It's people doing work on their spare time, so more power to them!) But I wonder if that will help or hinder it in the end. It's also unclear to me what Guile brings other than fracturing the Scheme/Lisp/Racket community further (there are other Schemes that are older, seemingly just as…

> NIMBYism

Do you mean NIH syndrome?

Re: Typing Nix

#104
post #11

Earlier quoted context omitted.

Except GUIX is more of a political project and part of the GNU "stack". It's a noble goal and I think it's great they're doing it. (It's people doing work on their spare time, so more power to them!) But I wonder if that will help or hinder it in the end. It's also unclear to me what Guile brings other than fracturing the Scheme/Lisp/Racket community further (there are other Schemes that are older, seemingly just as…

> NIMBYism Do you mean NIH syndrome?

yeah, thanks for the correction

Re: Typing Nix

#105
I'd like to bring up another sort-of alternative: http://habitat.sh

It's not exactly in the same space as Nix, but not very far from it, either. In Habitat, you use a language that felt to me quite similar to Arch Linux's PKGBUILDs, but extended with container-specific things like service ports etc. Habitat outputs containers that can be started in various orchestration technologies, like Kubernetes or Mesos/Marathon.

Re: Typing Nix

#106

There's also Guix in case anyone is interested. It uses Guile/Scheme for everything instead of Haskell.

I think that all the efforts to fix or re-implement the Nix language have vindicated Ludovic, the Guix maintainer, who chose an existing general-purpose language instead.

The only significant shortcoming of the Nix language is the lack of static types. Guix doesn't fix this. In fact there isn't an existing language in common use that offers statically-typed extensible records, which IMHO vindicates the bespoke approach.

Re: Typing Nix

#107

Earlier quoted context omitted.

Inserting a new element with comma-first changes 2 lines: - { old-one + { new-one + , old-one While trailing commas allow you to insert an element anywhere with just one line addition. This doesn't break anything, but it makes looking at "git blame" so much easier.

This is only true if you insert at the head. And it's not really leading comma placement but the choice to put the first element in the line with the brace that is the culprit, though both are typical of comma-first.

With separating comma, it either affects the first or the last position, depending on where you put the commas. But those are the most common places you modify lists.

Re: Typing Nix

#108
post #6

I love Nix. NixOS is my primary development operating system. However, the Nix language itself is syntactically ugly , and this proposal makes it even uglier. Parentheses, sigils and special characters (esp. semicolons) are line noise — the less of it the better. Why they wouldn't take the most (syntactically) beautiful functional programming language out there — Standard ML? It would work perfectly for such a task.…

> I cringe every time I have to edit a .nix file (and I have to do it a lot).

No need to cringe over syntax. Syntax is just syntax. If you are familiar with a better syntax to express Nix in then create a parser from that format to Nix' syntax. Then insert this parser as a pre-processor in the build process, and problem solved.

Re: Typing Nix

#109
post #91

Earlier quoted context omitted.

My aversion has to do with the fact that the first element doesn't have one. The irregularity is annoying not just aesthetically, but also if you want to swap lines around, etc.

But there's always a line without a comma -- comma-last has it on the last line instead of the first. So you can have the same line-swapping problem in either arrangement. Comma first just makes it easier to spot.

Not if you allow dangling commas (trailing commas as the sibling comment calls them, I think it's the more generic term)...

Then you have a comma at the end in ALL lines, including the last one, without an issue. That was what I proposed above (and lots of languages do it, I think JS is adding it too).

Re: Typing Nix

#110
post #105

I'd like to bring up another sort-of alternative: http://habitat.sh It's not exactly in the same space as Nix, but not very far from it, either. In Habitat, you use a language that felt to me quite similar to Arch Linux's PKGBUILDs, but extended with container-specific things like service ports etc. Habitat outputs containers that can be started in various orchestration technologies, like Kubernetes or Mesos/Marathon…

It's interesting and very similar to Nix, but I still didn't figure out purpose of it, especially why it heavily uses Docker. Many people use Docker for the same functionality that Nix provides: bundling application with its dependencies, not for isolating groups of processes from each other.
Post reply on HN