Lix Development | 424 Members | |
| (Technical) development of Lix, the package manager, a Nix implementation. Please be mindful of ongoing technical conversations in this channel. | 140 Servers |
| Sender | Message | Time |
|---|---|---|
| 23 Mar 2026 | ||
i feel like having an outside tool responsible for these sort of things just exerts a behavioral requirement on the nix code that cannot be encapsulated inside of the code, thus, from my point of view, going against purity. from a practical point of view, i do think that in the case of eg hydra it'd make a lot of sense for it to be external, but the idea of just forbidding tryEval completely and requiring external tools to handle any failing scenario seems a little weird.idk, again it's probably because i don't use nix for ci stuff as much, but if you can't handle any error at all and require an external runner and external tool and everything, then you suddenly nix becomes just the build description language surrounded by bash scripts, which imo is a shame | 22:26:50 | |
| imagining how relaxing will be May compared to these past months makes taking time off even better | 22:30:08 | |
| there's class of errors you simply cannot remediate to | 22:31:10 | |
| what if hash FOD mismatch was a Result<Derivation, FODMismatchError> | 22:31:22 | |
| what value is there into unwrapping the error? | 22:31:28 | |
| what can you meaningfully do with this information? | 22:31:36 | |
| to me, it is the basis to support moving some of the processing logic outside of Nix because those things have inherently impure management | 22:32:10 | |
| in order to leave Nix a pure core | 22:32:16 | |
| incompleteness of a derivation is yet another example and is driven by the lack of instrumented recursive evaluation of attribute sets IMHO, there's no way to perform fancy traversal of these graphs with impure action responses | 22:33:04 | |
nix-eval-jobs is one instrumented recursive evaluation of attribute sets meant as a porcelain to build more complicated tooling, it theoretically can also do way more than tryEval-based techniques because it has full access into the C++ evaluator primitives and can catch the uncatchable (modulo impl details) | 22:33:56 | |
| yeah, i have been aligned with horrors for a long time on this | 22:35:02 | |
| if we could create the conditions to remove that weird exception handling fragment, that'd be great | 22:36:13 | |
| i don't mind replacing it with Result<T, E> though I think as I said: it's a dream, I don't see that realistic compared to do it right in nix2 | 22:36:52 | |
i do agree with that tbf, and i think the FOD error is a good example of something that doesn't make sense to make catchable; but i don't think all errors should be that way. while in general, things related to bare derivations and building probably aren't gonna be the most useful to catch, the fact you can't run/use any nix expression inside your code without the fear that it might fatally throw is a little frustrating imo. if we did have a Result type it'd obviously be preferable to exceptions, but for the foreseeable future we won't, so i do think it's useful to be able to tell if e.g. some packages fail to eval in nixpkgs, or a property of a object we computed actually throws, etc | 22:46:42 | |
| anyway, i think i should maybe stop here, i don't have the same experience and "vision for nix" that most people have here ^^; | 22:47:23 | |
| i agree | 22:47:25 | |
| i think that approaching this problem from different perspective is welcome; but i think: for the exercise to be interesting, it needs to be thorough | 22:48:03 | |
| that is, for each current catchable/uncatchable behavior, providing a rationale for its current status or a rationale to change it | 22:48:23 | |
i know that i did that when i finished most of the catchable/uncatchable impl in https://snix.dev (which doesn't rely on exceptions but proper Result<T, E> at the Rust level) and i acquired some taste along the fun | 22:48:54 | |
| otherwise, we are kinda condemned into discussing n=1,2,3 examples and i'm not sure this will lead to a satisfying design overall | 22:49:28 | |
| to put it in another way: do not let grand words like "vision for nix" discourage you from finding out your own opinions and communicating them | 22:50:06 | |
| but i'd appreciate reading an overall coherent set of opinions if you find the time to do it ;-) | 22:50:17 | |
| (not saying you don't provide a coherent set of opinions atm, but more like, this is what i would like to read from a different perspective) | 22:50:41 | |
In reply to @blokyk:matrix.orgBasically at the core is the following problem: any fallibility which may depend on impure outside context propagates that impurity into the language if caught. I agree that not being able to catch runtime type errors is annoying though, and this may be fixable, but no guarantees (also a pproper type system would instant fix this entire class of issues) | 22:51:03 | |
| (i am somewhat reminded of the line i saw in last month's core team meting:
| 22:51:27 | |
| * (i am somewhat reminded of the line i saw in last month's core team meting:
and seeing everyone's very interesting ideas compared to just the "nix is fun :D functional programming is fun :D if only haskell $ operator tho :( and also not cursed :((" idea i have definitely makes me kinda resonate with that line (which, obviously no problem with that, i am a pretty boring person in general) x) | 22:52:06 | |
yeah, nix's lack of a type system is probably my biggest gripe with it; even stripping the cursed/badly designed parts of it, the dynamic nature makes writing nix just landmine after landmine | 22:52:57 | |
| anyway i do agree with the solution of making externally-caused errors uncatchable, that makes complete sense to me; it's really mostly runtime errors that annoy me | 22:55:47 | |
| * anyway i do agree with the solution of making externally-caused errors uncatchable, that makes complete sense to me; it's really mostly runtime errors that frustrate me | 22:55:52 | |
| i really shouldn't have been, but i was genuinely surprised that the actual evaluator uses c++ exceptions to propagate eval/user-facing errors, instead of using a result type; it just felt... dirty. again, really shouldn't have been surprised, it is the nix codebase after all x) | 22:58:57 | |