3 ms·
FWIW, Nickel is one attempt from the Nix community at creating a Nix-like language with static typing, as well as better error reporting I believe: https://nic
by akavel 3y ago
FWIW, Nickel is one attempt from the Nix community at creating a Nix-like language with static typing, as well as better error reporting I believe:
https://nickel-lang.org https://nickel-lang.org
As far as more loosely related technology, there's also https://cuelang.org https://cuelang.org, which is... something different.
- unshavedyak 3y agoMan i can't wait for Nickel to work with Nix. Feels impossibly difficult though. I often think that making Nix logic + configuration is just a mistake. I kinda feel like i'd prefer something that output a JSON-like config, and that config was a deterministic instruction for my stuff. I know why that sounds impossible or big or difficult or etc. but as a user, i often am writing something that walks and talks almost and so damn close to JSON. Most of it looks like simple configuration. But can i print a damn JSON object? Hell no. Because there's lazy function calls all over the place. They managed to make something (and other similar langs) that looks like clean readable configuration, but acts like some obtuse bespoke logic where you can't know what anything is without running it - and running it to see output is weirdly difficult. I am on Nix, but i kinda think there's more than one fatal flaw. I adore what they've done, but there has to be something better and more enjoyable as a system configuration.. i hope. It's probably a tooling problem. I get that. But still.. i just want to see some configuration output. Why is that so hard?
- Cu3PO42 3y agoI'm rooting for Nickel, I really am, but I am doubtful. Nix is so incredibly dynamic that I believe it's nearly impossible to give it a practical static type system. I say practicaly because I do believe it is possible to come up with a reasonable type system, it's just that it would be so complicated to use that hardly anyone actually would outside of extremely specific applications (see Agda, Idris, ...). In order to get something more reasonable, I think we would also need to rethink both the NixOS module and nixpkgs DSLs. Which is of course possible, but such a momentous task that I don't see it gaining much traction. I think it's more realistic, and maybe even sufficient to integrate better error reporting into Nix itself. This is surely also no easy feat, but I am confident some improvements could be made: for example, more acurate tracking of source locations. And while I almost always prefer static over dynamic typing, writing a specific NixOS config feels like it's one of the moments where it's less important, because I don't care about all possible executions working, I just need my specific config to work. This all changes once you write your own modules, where you obviously want all configurations to work, but that is less important for end user adoption IMO.
- PrimeMcFly 3y agoI had thought the Nix 'language' was just a way to describe packages, dependencies and configs, more a config format than a language. Why would it need static typing?