Re:Flakes – Proposed mechanism to package Nix expressions in...
by vertex-four on Saturday July 20, 2019 @06:59PM
(#20488856)
I'm not sure what to say. Replace the = signs with colons, the semicolons with commas, stick commas between array elements and stick everything between quotes and you basically have json.
[ Parent
| on HN ]
Re:Flakes – Proposed mechanism to package Nix expressions in...
by weberc2 on Sunday July 21, 2019 @08:24AM
(#20491038)
The complicated bits are the import notations (what do the different variations mean and when to use them?), the recursive declarations (and knowing when to use them). Also, since expressions are often functions and the nixpkgs people don’t believe in types or docs, it’s difficult to track down the type info for each argument (what properties does it have?). You just end up grepping blindly through nixpkgs to find the callsite and even then the argument is often the result of a function call, so you have to find the function and it’s definition and look at the return and hope that it is not “return someOtherFunc()” lest you have to track down yet another function (also, odds are “someOtherFunc” is not the name of the function, but rather the name of a parameter into which a function was passed, so you’re back to blindly grepping nixpkgs).
Nix is great in concept but the language or idioms make it really difficult to use.
Re:Flakes – Proposed mechanism to package Nix expressions in...
by tannhaeuser on Sunday July 21, 2019 @02:42AM
(#20490249)
That looks like a Turing-complete DSL. Not like JSON at all. Do we need yet another Turing-complete language for writing package metadata?
Re:Flakes – Proposed mechanism to package Nix expressions in...
by viraptor on Sunday July 21, 2019 @03:19AM
(#20490326)
The example lacks functions / flow-control statements (ok, apart from "import if not defined", but it's more of a default value than a branch) / references to other elements. It's pretty much key-value dictionary. Not sure how you got an impression of Turing-complete DSL from that, since it would require at least one of them.
Re:Flakes – Proposed mechanism to package Nix expressions in...
by weberc2 on Sunday July 21, 2019 @08:26AM
(#20491043)
The Nix expression language has branches and functions (including recursive functions). It is Turing complete, and it probably is necessary for its charter.
Re:Flakes – Proposed mechanism to package Nix expressions in...
by viraptor on Sunday July 21, 2019 @05:36PM
(#20493824)
OP said it "looks like" a Turing complete DSL just from the example. Regardless of what extra functionality the actually is, the examples didn't suggest it.