Live data from Hacker News

Typing Nix

tweag.io

71–80 of 128 posts

Re: Typing Nix

#71

Earlier quoted context omitted.

I need CUDA drivers for what I am working with, and I have found no way to install it in Guix. Otherwise, it looks interesting enough. (Sexps are usually not my first choice, I think it is a "lazy option" for people who do not want to write parsers / design their own syntax. Even then, they are better than current Nix expressions).

AFAICT, there are 2 major differences between Nix and Guix. Language choice is the obvious one. The other is that Guix takes a hard-line stance on the GNU philosophy and therefore refuses to distribute pre-compiled binaries. I don't think CUDA will ever be an option on Guix.

Pretty sure there is nothing language-wise stopping anyone from hosting a separate repository with pre-compiled binaries.

It's a volunteer-run service. It makes sense they don't want to host your proprietary binaries

Re: Typing Nix

#72
post #55
post #36

Earlier quoted context omitted.

I love the Nix language and I generally distrust aesthetic feelings about programming languages. Neither SML nor Haskell are optimized for expressing deeply nested records with many string literals, for example. The multiline interpolated strings in Nix are extremely much better than in SML or Haskell. The way records and arrays are written is great: SML and Haskell both suffer from the tedious problem of using separ…

> If you can make a better surface syntax ... http://gnu.org/s/guix Lisp is pretty good at lists. The only important language is the derivation language sent to the daemon. Nix spends so much time building up inputs... for shell scripts. I always felt like they would have been so much more successful if they chose some other, more popular language to generate derivation.

I dig Guix, but Lisp is also one of the most commonly reviled syntaxes, so it's hard to say it's clearly better, or that Nix would enjoy more adoption with S-expressions.

Re: Typing Nix

#73
post #63

Earlier quoted context omitted.

Is there any real disadvantage to comma-first, other than aesthetics (which is entirely a personal preference)?

Yes, when the commas are at the beginning of the line they are really obvious. I have used commas-first style in JavaScript, and it definitely reduced the amount of times I forgot a comma. I wonder if people's aversion to commas first has something to do with the fact that commas have a very familiar use in ordinary writing, and there they always follow a word. It is very common to see BNF grammars written with leadi…

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.

Re: Typing Nix

#74
post #70
post #51

Earlier quoted context omitted.

I see. But that means using a whitespace-sensitive syntax, which some people (including me ;) ) don't really like

Very strongly agreed. Syntactically significant whitespace is the source of so many preventable errors that I believe it's simply not worth the aesthetic improvements.

There is no significant whitespace in what I am offering; just semicolon inference at newlines (like in modern Javascript).

Re: Typing Nix

#75
post #21

Earlier quoted context omitted.

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 :) )

You claim that conda "isn't very well supported by Unix as a whole" and "doesn't really work." Can you provide some evidence or examples to back up your claim?

Sorry, I guess it basically requires you already know the ways in which Conda doesn't work. The basic problem is that Unix has a lot of hardcoded paths and no way to override them all at runtime. So you need to do lots of patching and hacks.

Re: Typing Nix

#76
post #36
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 love the Nix language and I generally distrust aesthetic feelings about programming languages. Neither SML nor Haskell are optimized for expressing deeply nested records with many string literals, for example. The multiline interpolated strings in Nix are extremely much better than in SML or Haskell. The way records and arrays are written is great: SML and Haskell both suffer from the tedious problem of using separ…

So, JavaScript? The records literals are JSON, which is the most popular syntax for this at the moment anyways.

Re: Typing Nix

#77
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.…

Really? I write almost nix every day at work and I have no problem with the syntax. I think it's pretty elegant and well-suited to its use case. There are a few minor tweaks I would make but nothing big at the syntactic level. EDIT: probably the only gripe I would make is to have comma-separated lists instead of having to use parentheses to separate non-atomic expressions.

> probably the only gripe I would make is to have comma-separated lists instead of having to use parentheses to separate non-atomic expressions.

Wait no separators are evil. This is the best thing about the syntax.

Re: Typing Nix

#78
post #72
post #55

Earlier quoted context omitted.

> If you can make a better surface syntax ... http://gnu.org/s/guix Lisp is pretty good at lists. The only important language is the derivation language sent to the daemon. Nix spends so much time building up inputs... for shell scripts. I always felt like they would have been so much more successful if they chose some other, more popular language to generate derivation.

I dig Guix, but Lisp is also one of the most commonly reviled syntaxes, so it's hard to say it's clearly better, or that Nix would enjoy more adoption with S-expressions.

Most commonly and with lots ans lots of prejudice.

Re: Typing Nix

#79
post #9
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.…

It's one of those languages that a developer can look at and think "Oh, so this is how non-developers see code".

I have no idea why you would think that. It's pretty standard usage of punctuation like (){}[] etc. If it's hard to read that's because the libraries and infrastructure for writing derivations is not simple or well-documented. But that's not a language issue.

Re: Typing Nix

#80
post #53

Earlier quoted context omitted.

How about allowing for bloody danging commas?

Is there any real disadvantage to comma-first, other than aesthetics (which is entirely a personal preference)?

It makes git diffs inaccurate compared to trailing commas.
Post reply on HN