Some time ago I wanted to write a Nix configuration dsl for an application I use.
My effort halted due to lack of type checking, and implementing one felt like too much effort which would never pay back.
I was a bit skeptical at first coz my experience so far has been that Nix's weak typing quite rarely causes me problems.
(Likely because NixOS options tend to be how I communicate between pieces of code, and those have a good enough type system).
But actually I think, as something that you just use occasionally like in your JSON example, this could be really cool. I wouldn't wanna use it as "gradual typing" in the sense of aiming to gradually type a whole body of code I think I would be more interested in "selective typing".
Just occasionally when you get that itch of "ugh this will fail really ungracefully if the inputs are bad" then you just apply this where it's needed.
7 comments
[ 2.6 ms ] story [ 25.6 ms ] threadThe font presented under NixOS + Firefox is near unreadable on this website.
Some time ago I wanted to write a Nix configuration dsl for an application I use. My effort halted due to lack of type checking, and implementing one felt like too much effort which would never pay back.
I'll give a try.
(Likely because NixOS options tend to be how I communicate between pieces of code, and those have a good enough type system).
But actually I think, as something that you just use occasionally like in your JSON example, this could be really cool. I wouldn't wanna use it as "gradual typing" in the sense of aiming to gradually type a whole body of code I think I would be more interested in "selective typing".
Just occasionally when you get that itch of "ugh this will fail really ungracefully if the inputs are bad" then you just apply this where it's needed.
1. https://github.com/NixOS/rfcs/pull/189
2. https://github.com/NixOS/nixpkgs/pull/485453