For a long time I wondered how I could make RCL scale to large
repositories (e.g. Nixpkgs), because evaluation is completely
sequential, and it's hard to parallelize because you only discover the
imports during evaluation, and then you'd have to do some kind of
laziness, add thunks for a "pending evaluation" value, but then that
pollutes the entire evaluator that now has to force thunks. Laziness
also disturbs assertions ... if I import a file but never use it, should
its violated assertions surface? I think they should, but with laziness
they would not.
But now that I'm writing the typechecker, I had a realization. When the
typechecker encounters an import statement, it can go and load the file
in the background, and typecheck it already. It can even evaluate it
already, speculatively.