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
Currently, if you have multiple files, A.sc importing B.sc importing C.sc, the control flow is depth first: A triggers processModule on B, triggers processModule on C, and they then evaluate in reverse: C then B then A.
This workflow provides flexibility: e.g. if you dynamically interp.load.ivy inside B, you can use the results in A. In exchange, this design doesn't allow you to compile A before executingB, which makes "pre-compiling" a dependency-graph of scripts to check for basic correctness impossible.
A different way of doing this could be to resolve only the import hooks first, without compilation or execution, and then perform compilation of all dependent scripts after, and then execute everything at once.
That advantage of the alternate design is that it will let us resolve AB and C all at once, and compile everything to check for correctness without running the script locally. That would be a good step up in correctness, e.g. if you want to type-check your deployment scripts locally but only run them later in the deployment environment.
It would likely also result in a compilation speedup, since it would avoid the overhead the overhead of starting lots of compilation runs for each individual file
The text was updated successfully, but these errors were encountered:
Currently, if you have multiple files,
A.sc
importingB.sc
importingC.sc
, the control flow is depth first:A
triggersprocessModule
onB
, triggersprocessModule
onC
, and they then evaluate in reverse:C
thenB
thenA
.This workflow provides flexibility: e.g. if you dynamically
interp.load.ivy
insideB
, you can use the results inA
. In exchange, this design doesn't allow you to compileA
before executingB
, which makes "pre-compiling" a dependency-graph of scripts to check for basic correctness impossible.A different way of doing this could be to resolve only the import hooks first, without compilation or execution, and then perform compilation of all dependent scripts after, and then execute everything at once.
That advantage of the alternate design is that it will let us resolve
A
B
andC
all at once, and compile everything to check for correctness without running the script locally. That would be a good step up in correctness, e.g. if you want to type-check your deployment scripts locally but only run them later in the deployment environment.It would likely also result in a compilation speedup, since it would avoid the overhead the overhead of starting lots of compilation runs for each individual file
The text was updated successfully, but these errors were encountered: