Open copumpkin opened 7 years ago
Having static warnings would probably be quite hard[1] because the language is too dynamic, but having an evaluation mode where those warnings are thrown at runtime should be easier, and already really nice.
[1]: although some errors could probably be caught by the type-checker I'm writing
I marked this as stale due to inactivity. → More info
It'd be nice if I could opt into warnings, like I can with many compilers (e.g.,
-Wall
,-Werror
, etc. in C compilers).The most obvious warning that comes to mind would look something like this:
That would indicate if you have a
with
binding in scope while also having the same binding from the outer scope. I'm sure there are a few other "likely programmer errors" we could catch this way.Another implementation could be to have a
nix lint
subcommand in the new UI, but I'm afraid of branching the expression language handling too much from the actual evaluation of the language, so it seems like it would need to be integrated intolibexpr
somehow.Related to #1361.