-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting a handle on the current state is hard #767
Comments
#554 gets us pretty close - with that PR Hnix produces output paths on par with Nix. That one was blocked by Then there's a complicated one which is path filtering (#755 + haskell-nix/hnix-store#72) as it makes our transfomer stacks explode a bit. That said everything is gonna be slow and we might uncover tons of other issues (Hnix/Nix inconsistencies) when we actually start using Hnix at its full potential. If you don't need evaluation / building then Hnix is pretty viable and stable solution already and there are few projects that use it as library e.g. |
@sorki thanks! https://github.com/input-output-hk/haskell.nix uses My primary motivation for looking at hnix would be nix being too slow. And really bad at evaluation, especially around IFDs. I'd like to improve this, but I'd rather not work with C++ if I can help it. /cc @Ericson2314 -- because you didn't know either :p |
Hi @angerman, To elaborate on @sorki answer, here is the graps I got while playing with HNix. At the moment, it is good at parsing nix code. As the parser is feature rich, it can help finding location of expressions, and potentially debug code (but no interface like that exists AFAIK). @sorki has a very good project highlighting what can be done with HNix: https://github.com/sorki/update-nix-file. With #554 you get an extra step because you can now evaluate derivations, and get a proper .drv in the nix store. I manged to evaluate nixpkgs.firefox for example. As it is easy to compare the output of nix and hnix, It helped discover a lot of small discrepancies between nix and hnix (#757, #756). To discover what is missing, you should have a look at Builtins.hs to find missing builtins, and the ones that defer to nix through a system call (as was the case with derivationStrict). Some of them are "simple" but no-one knows exactly how to implement them without a bit a thinking, nor cared to do so ( Two bigger parts remain.
HNix is not capable of instantiating derivations by itself. I do not think that the project intends to redefine execution, sandboxing, permissions and daemons like nix does. |
Having gone through OP's thought process too recently, I agree. Hopefully this issue helps that |
So I'd like to suggest that first of all, this issue be pinned, but second, I feel much of the confusion about current state stems from the fact that there is a genuinely insane number of issues (the former is to slightly mitigate the latter) |
@angerman regarding #767 (comment)
Canonical Nix is unperfect ad-hock dynamically type-checked, that is from where the terrible Nix lang code debugging comes from. In HNix - the parsing, testing, debugging, the code evaluation are the project strongpoints that are forming. Due to Haskell & Nix languages share the paradigms. Due to Haskell strong type system & HNix nix lang type system implementation. The project would have superior parsing, debugging, and evaluation capabilities. Code is already pretty lean in terms of size and conciseness. And after refactoring due to paradigm alignment the code should become leaner. When everything in the Nix type system would be Ok - HNix should be able to even compile the Nix code. So, happy to receive improvements. The speed question is addressed in the #781 (comment) and further. |
And currently, it is not strange that the project status is somewhat hard to grasp. |
"Project status" currently formed by the composition on the theme from #767 (comment) & #767 (comment)
To address the headpost topic "Getting a handle on the current state is hard":
In the future, the design notes and project status should be in one article, so we can go and change/update everything in one place. |
Trying to understand where Hnix is compared to nix. The readme suggests hnix can't evaluate nixpkgs, but it's not very clear what exactly the open issues/complications are.
If I wanted to replace nix with hnix today, what issues would need to be solved?
The text was updated successfully, but these errors were encountered: