totality checking in nickel #1357
Replies: 2 comments 4 replies
-
Out of curiosity, were those recursive functions related to NixOS modules, or just plain recursive functions? Were there functions you wrote yourself, or that you consumed as part of a library? For now, I must say that there's no such plan. Nickel is gradually typed and intentionally Turing-complete, which makes totality checking a bit of a challenge. The design philosophy here is to provide as many array and record combinators that you can do without recursive functions as much as possible. So, if you really want to avoid recursion, I think that should be possible, by just relying on One angle we thought of, at some point, was to check totality for records. Because records are recursive by default, you could theoretically have loops there. But in practice what you want most of the time is a well-defined dependency tree (or DAG). This could be implemented without a lot of effort, as Nickel tracks (syntactically) the dependencies of record fields already. |
Beta Was this translation helpful? Give feedback.
-
just plain old recursive functions, I am curious, is there some property of gradually typed languages that make totality checking difficult? Ive never really gone to take a look at how proof assistants do it internally so i wouldn't know. |
Beta Was this translation helpful? Give feedback.
-
does nickel plan on ever supporting totality checking to any degree? because some of my worst experences with nix were debuging recursive functions
Beta Was this translation helpful? Give feedback.
All reactions