Dhall-lang: Freeze Prelude ?

Created on 11 Mar 2019  Â·  3Comments  Â·  Source: dhall-lang/dhall-lang

Currently, importing the root of the prelude in a dhall file slows down the evaluation considerably if one doesn't add a checksum. Could we could run dhall freeze on the whole Prelude, so that most of it would get cached automatically when imported ? This might be a bit annoying when updating the prelude, but would make using the prelude much smoother.

Most helpful comment

@Nadrieril: Yes, this is possible now that newer versions of the interpreter support stable hashes. I would only add one caveat, which is that we should provide a non-hashed fallback import just in case users aren't on a sufficiently new version of the interpreter. i.e.:

-- ./package.dhall

{ `Bool` = ./Bool/package.dhall sha256:… ? ./Bool/package.dhall
, …
}

That way if the semantic integrity check fails due to them being on an older version it still gracefully degrades to an uncached import

All 3 comments

@Nadrieril: Yes, this is possible now that newer versions of the interpreter support stable hashes. I would only add one caveat, which is that we should provide a non-hashed fallback import just in case users aren't on a sufficiently new version of the interpreter. i.e.:

-- ./package.dhall

{ `Bool` = ./Bool/package.dhall sha256:… ? ./Bool/package.dhall
, …
}

That way if the semantic integrity check fails due to them being on an older version it still gracefully degrades to an uncached import

Thanks !

Was this page helpful?
0 / 5 - 0 ratings