You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When importing an expression, the imported expression needs to be type-checked before it is included into the importing expression. When this expression is imported itself it will also be type-checked and in that process the first expression will be typechecked again.
Consider the following scenario
A.dhall --> B.dhall --> C.dhall (where x --> y stands for x imports y)
The resolution phase will do the following steps:
Aᵣ = resolve A.dhall
B = import B.dhall
Bᵣ = resolve B.dhall
C = import C.dhall
Cᵣ = resolve C
type-check Cᵣ
type check Bᵣ (which now includes Cᵣ)
...
This gets worse the deeper the nesting of imports is.
A file might also be included multiple times through different paths. While the imported & type-checked expression is cached during one resolution phase, the included expression will still be type-checked again as part of the including expression.
For example tests/type-inference/success/preludeA.dhall includes around 100 files (all of prelude). And especially the more complex expression in the JSON, YAML and XML folders include a lot of the basic expressions from String, List and Map folders over and over again.
This causes the type-checking of this file to take multiple hours at the moment.
Storing the resolved type of a sub-expression inside the AST should greatly optimize this
The text was updated successfully, but these errors were encountered:
When importing an expression, the imported expression needs to be type-checked before it is included into the importing expression. When this expression is imported itself it will also be type-checked and in that process the first expression will be typechecked again.
Consider the following scenario
The resolution phase will do the following steps:
This gets worse the deeper the nesting of imports is.
A file might also be included multiple times through different paths. While the imported & type-checked expression is cached during one resolution phase, the included expression will still be type-checked again as part of the including expression.
For example tests/type-inference/success/preludeA.dhall includes around 100 files (all of prelude). And especially the more complex expression in the JSON, YAML and XML folders include a lot of the basic expressions from String, List and Map folders over and over again.
This causes the type-checking of this file to take multiple hours at the moment.
Storing the resolved type of a sub-expression inside the AST should greatly optimize this
The text was updated successfully, but these errors were encountered: