4 ms·
> Maybe this is nitpicking, but: the Nix language is about as straightforward as "JSON plus functions". Maybe that is difficult for people who haven't had an ex
by ashtonkem 5y ago
> Maybe this is nitpicking, but: the Nix language is about as straightforward as "JSON plus functions". Maybe that is difficult for people who haven't had an experience with pure/functional programming?
I've programmed professionally in Lisp (SBCL) and Clojure, and done a lot of hobby work in Haskell and Rust. I found Nix the language utterly incomprehensible largely because of documentation and tooling reasons.
- ghostwriter 5y agoI've programmed professionally in Haskell, I find Nix the Language to be one of the nicest DSLs for defining build pipelines. It's lazy, pure, and it's sandboxed. Whenever you need types on top of it you just pick Dhall and dhall-nix and continue with a productivity gain.
- kaba0 5y agoWow, I just commented that dhall would probably be a fruitful language to consider for nix! And it seems to exist, though according to the readme, general recursion, not strongly typed code and row polymorphism is not supported by dhall but is used heavily by nix :/ Do you by chance know whether a non-Turing complete language like Dhall would be enough to “replace” nix?
- ghostwriter 5y ago> Do you by chance know whether a non-Turing complete language like Dhall would be enough to “replace” nix? Realistically, I'd say Dhall should be viewed as a complimentary typed DSL for Nix instead "a replacement". Dhall shines when it's used as a code-generator for recursive Nix expressions from typed configs that capture the intent of a build pipeline. You can see how it can be generated from this Haskell example, for instance [1]. The [2] shows you the available constructs, that do support recursive calls and recursive Nix sets. [1] https://hackage.haskell.org/package/dhall-nix-1.1.23/docs/Dhall-Nix.html#g:1 https://hackage.haskell.org/package/dhall-nix-1.1.23/docs/Dh... [2] https://hackage.haskell.org/package/hnix-0.14.0.2/docs/Nix-Expr-Types.html#t:NExprF https://hackage.haskell.org/package/hnix-0.14.0.2/docs/Nix-E...