Skip to content
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

dhall-nix? #75

Closed
MichaelXavier opened this issue Feb 7, 2019 · 7 comments
Closed

dhall-nix? #75

MichaelXavier opened this issue Feb 7, 2019 · 7 comments

Comments

@MichaelXavier
Copy link

This may be more of a question than an issue. I noticed in the main README you mention that nix has worse error messages and that is owed to not having a type system. I'm wondering if you have used dhall-nix to address this. The syntax is so similar that it doesn't seem like it would add much overhead in terms of noise. Is the problem that you'd need to layer a build process (make?) over the whole project to convert your source-controlled dhall expressions into git-ignored nix expressions?

@Gabriella439
Copy link
Owner

@MichaelXavier: You don't need to add an additional build process. There is a dhallToNix function I added to Nixpkgs which will convert Dhall source code to Nix at evaluation time (using import-from-derivation):

https://github.com/NixOS/nixpkgs/blob/92a047a6c4d46a222e9c323ea85882d0a7a13af8/pkgs/build-support/dhall-to-nix.nix

Note that it's restricted to an older version of dhall until hnix publishes a new release.

That said, I haven't made a serious attempt to use dhall-nix to replace Nix yet. dhall-nix is so far mostly a "proof-of-concept" project.

@MichaelXavier
Copy link
Author

Thanks for the quick response, @Gabriel439. I'm curious if you have any doubts about its usability as a replacement. Maybe when you get used to the nix syntax and error messages, that particular downside to the nix expression language isn't a big enough problem to bother with?

@Gabriella439
Copy link
Owner

@MichaelXavier: The main issue is that Nixpkgs depends heavily on weakly-typed idioms and general recursion which you can't embed in Dhall. So you can carve out some strongly-typed islands using Dhall, but you'll hit a wall pretty quickly. I think a slightly more promising approach is https://github.com/dhallix which is basically an attempt to redo something like Nixpkgs except in a way more idiomatic to Dhall, but that requires significant performance improvements to the interpreter to be realistic

@MichaelXavier
Copy link
Author

@Gabriel439 thanks! All of that makes sense. I've got a few more hours under my belt with dhall and started to see where nix exceeds the functionality that dhall limits itself to or how performance could be an issue when you're evaluating huge expressions.

@Gabriella439
Copy link
Owner

You're welcome! 🙂

@midirhee12
Copy link

midirhee12 commented Jul 13, 2019

Note that it's restricted to an older version of dhall until hnix publishes a new release.

@Gabriel439
Is there any update on this? I love the dhall project to death.

@Gabriella439
Copy link
Owner

@cvoges12: This will be fixed in the next release (~ 1 week from now). See: dhall-lang/dhall-haskell#1000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants