-
Notifications
You must be signed in to change notification settings - Fork 830
Description
The recent awesome work on parallel parsing and IL gen got me thinking whether it would be feasible to parallelize type checking as well.
Given F#'s significant file order, if the compiler can quickly establish that file B can't possibly reference anything in file A declared directly above it, can't A and B be typechecked (and optimized) simultaneously? This would require an initial traversal of the AST in every file in order to create a file dependency graph. Specifically, things like this need to be checked:
- If
Bopens a module or class defined inA,Bdepends onA - If
Acontains anAutoOpenthat has immediate effect inB(because of overlapping namespaces, regardless of actual contents),Bdepends onA - If
Breferences something fromAusing a qualified name,Bdepends onA
I think these can be gleaned from the untyped syntax tree alone, the question is whether it would be fast enough to offset the overhead and whether typechecking has a significant cost. Apologies in advance if there's a gaping flaw in here somewhere :).