4 ms·
So, JavaScript? The records literals are JSON, which is the most popular syntax for this at the moment anyways.
by qznc 9y ago
So, JavaScript? The records literals are JSON, which is the most popular syntax for this at the moment anyways.
- mbrock 9y agoI tend to write JavaScript that looks a bit like Nix... but in general, the imperative constructs aren't suitable to the lazy evaluation strategy of Nix.
- cwp 9y agoNo, Nix syntax is much nicer than Javascript. Consider, for example, the similarity between a let expression and an attribute set (NOT JSON by the way): let foo = 42; bar = "a string"; in { baz = "deja"; quux = "vu"; } Javascript: const foo = 42; const bar = "a string"; return { baz: "similar", quux: "but different" }; You find this kind of thing all over the place. Nix is a much smaller and simpler language syntactically, and more pleasant to write.
- mbrock 9y agoAlso, recursive definitions using "rec" which become nasty in JavaScript.