Live data from Hacker News

Typing Nix

tweag.io

61–70 of 128 posts

Re: Typing Nix

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

Aside: I would love it if ML caught on. Such a good balance between expressiveness and usability. Imagine if Caml had caught on in the 90s instead of Java...

Re: Typing Nix

#62
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's another thing to learn, and the total learning curve is the product of all of these idiosyncrasies (and features) (not the sum). And there's absolutely no advantage to comma-first.

Re: Typing Nix

#63
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)?

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 leading vertical bars, and no one seems to mind that -- in fact it would be unusual to use trailing vertical bars.

By the way, a bunch of languages permit a trailing comma after the last element of a list. This is also nice because it means that if you put each list item on a line, the list items all have the same format (thing plus comma). With the Haskell syntax, you lose this, but there is no reason a language couldn't support a leading comma before the first element of a list.

Re: Typing Nix

#64
post #48

Sure it would be nice to have types for refactoring, but a more useful set of features would be: - baked in fetchurl, fetchgit for easier bootstrapping - a functional dsl for rendering filesystem hierarchies - instead of the find/sed/awk galore. 50% of the time when my nix recipe breaks it's not a nix syntax issue but something with bash. (reading nix is an exercise in learning new unix features) - drop the channel f…

for your first point., what about `builtins.fetchTarball` and `builtins.fetchurl` (`fetchgit` is in nix unstable afaik)

Re: Typing Nix

#65
post #41

Earlier quoted context omitted.

Slightly related: Why does Github call Vimscript "VimL"?

It's not just Github, the Vim filetype is "viml". It's a standard name for the language. Most likely meaning Vim Language.

No, it's not. The filetype is "vim", and the filetype detection code explicitly calls it "Vim script": https://github.com/vim/vim/blob/4670490673ed98502a09b74fbabe...

Re: Typing Nix

#66
post #4

Funny: Nix is short (or colloquial) for "nichts" in German which further means "nothing" in English. So the CTA "Get Nix" is kinda funny for German speaking people :) PS: Greetings from Austria!

I believe that this meaning is even intentional, the original author of nix (Eelco Dolstra) is from the Netherlands. The name comes from the fact that by default, nothing is available in build environments in nix.

Re: Typing Nix

#67
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)?

The wrath of God that it imposes on people who think it's acceptable, for one...

Re: Typing Nix

#68
post #41

Earlier quoted context omitted.

It's not just Github, the Vim filetype is "viml". It's a standard name for the language. Most likely meaning Vim Language.

No, it's not. The filetype is "vim", and the filetype detection code explicitly calls it "Vim script": https://github.com/vim/vim/blob/4670490673ed98502a09b74fbabe...

You're right, apologies, I was thinking of the Syntastic/Neomake plugin which both use "VimL" as an identifer, which I had just set up this past weekend and I mistook that as the Vim filetype identifier.

Regardless Wikipedia says:

> Vim script (also called vimscript or VimL) is the scripting language built into Vim.

https://www.wikiwand.com/en/Vim_(text_editor)#/Vim_script

It's also colloquially referred to VimL across the web.

For those looking for an answer, the 3rd result from googling "VimL" is a question on StackOverflow "Why does VimL suck?" which does a good job of answering my question:

https://www.reddit.com/r/vim/comments/1bf672/why_does_viml_s...

Re: Typing Nix

#69
post #2

Nice. Half-OT: How is the new CLI coming along? AFAIK there was an effort to make Nix usage a bit more like known from other package managers.

There's an effort to make Nix's CLI better, but not necessarily like other package managers. The design is at https://gist.github.com/edolstra/efcadfd240c2d8906348 The issue is at https://github.com/NixOS/nix/issues/779

One year, and still not closed...

Is this an ongoing process and most of it is already released or is this still in the making?

Re: Typing Nix

#70
post #51

Earlier quoted context omitted.

Just look: https://gist.github.com/atemerev/889806081ed8fcb77495666fac9...

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.
Post reply on HN