← Back to context

Comment by isityettime

2 days ago

Nix isn't a scripting language in the sense you seem to have in mind. The snippets you saw that looked like Bash most likely were literally Bash, embedded as multiline strings in Nix.

Nix doesn't have much in common with Haskell.

Nix is a really small language, and you can learn pretty much all of it in a few minutes: https://nixcloud.io/tour/?id=introduction/nix

Nix is awesome and has not been part of any pendulum (or clock). It's complex enough that it allows you to build programs with it, but on such a simple core that for all intents and purposes it is a config language.

  • yeah i honestly like it a lot too, but i wish it was typed and that the tooling around it was better. though it's getting there...

    • There's a language called "Nickel" which grew (eventually! it took a long time) out of efforts to add a type system to Nix. It's still early days in that it's under very active development and evaluation performance still lags behind Nix, it it's feature-complete enough to be useful for some things.

      The core work is driven by programming languages people, and chiefly one in particular. But its initial outline and subsequent design decisions have all been informed both by a survey of existing configuration languages (and I mean interesting ones, like CUE, Jsonnet and Starklark) and input from Nix people. I think it's fair to call it "state-of-the-art". (Whether that last point is good or bad depends on your perspective, I guess!)

      Besides the type system, better error messages, and integrating something like the Nix module system as a first-class language feature, there's been more emphasis on tooling than Nix had at comparable stages of its own development (including LSP support).

      I think it's a really interesting language. If its bet pans out, it'll stand out among configuration languages for offering a nice gradient of simplicity and sophistication, like Nix does: simple configs feel plainly readable, inert, and unceremonious, but you have enough power to offer clean interfaces if you're writing something that adds new features. But it promises to do it without the sharp edges Nix has. Time will tell!

      https://nickel-lang.org/

      https://github.com/nickel-lang/nickel