-
Notifications
You must be signed in to change notification settings - Fork 213
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 resolve" does too much #2116
Comments
Hmm. Github's syntax highlighting appears to be slightly broken - wrong colour for the opening bracket in |
In your example, the output is fully normalized because the input expression is a single import:
In principle, we could also extend |
Ah, thanks, that suddenly makes a lot of sense. Is there any particular reason for it to be the way it currently is? Keeping normalisation separate seems preferable on the face of it. |
@georgefst: There is a high likelihood that I will propose changing the standard to disable the behavior of pre-normalizing all imports. This is in part to fix the performance issues discussed in #1890 (comment) |
@Gabriel439 That would be great! There's still a potential blowup from diamond dependencies. But that seems like something I can experiment with downstream. e.g. introducing a new let-binding with a fresh name. |
@georgefst: Yes, I plan to fix the diamond dependency issue, too. The idea is that if an import is protected by an integrity check then we don't have to resolve the import in order to cache it. We would just cache the import separately and then resolve it from the cache on the fly when decoding anything that imports it with an integrity check. That ensures that we only ever cache one copy of an import within the entire cache. |
Has there been any progress towards this? It's still my main frustration with Dhall. (I don't like to pester maintainers - I'm just genuinely curious whether there are any threads I've missed) |
@georgefst: No worries! There hasn't been progress on this recently |
Re-reading, I realise this doesn't quite solve the issue I'm thinking of. My use case for |
@georgefst: I believe the combination of:
… would suffice to give you the performance improvement you're looking for, at least when using the Haskell implementation of Dhall. This is because the implementation is smart enough to avoid duplicating sub-expressions when they are referenced multiple times. The exception is if the final result display to the user or conversion tool contains duplicate sub-expressions, in which case it has to actually render all of them. That's unavoidable. |
I was under the impression that
dhall resolve
would just substitute in the contents of import expressions. But it sometimes performs a normalisation step that can cause a huge blowup in output size. e.g.I would have expected
let x = < A | B | C > in [ x.A, x.B ]
.In my actual use case, this is resulting in an output of over 100,000 lines, instead of under 1000 (there's a 540-member sum type involved...).
The text was updated successfully, but these errors were encountered: