effekt-lang / effekt-lang/effekt
Refactor: improve testability by separating dependency discovery from frontend
- Dominant language
- Scala
- Stars
- 469
- Forks
- 41
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 23
Description
Separate out finding and loading files of dependencies into
--> -->
main ---> Dependency Discovery --> Compiler --> CompilationUnit --> Backend
| --> --> |
v v
Reading Files Writing Files
The compiler should always receive a single file to compile and all compiled (typed, lowered, ...) dependencies.
In consequence, it _could_ in principle be parallelized to a certain degree. However, this refactoring is more important for reasoning and testing, than it is for performance.
### Advantages
Processing the files in topological ordering of their dependencies would remove the dependency of `Namer` on `Compiler.frontend`. In consequence, `Compiler` and `Context` wouldn't need to be mutually recursive anymore.
### Problem
If we use such an architecture, then we can't use the Task infrastructure anymore.
At the moment, the frontend task itself invokes frontend on other files, which registers the dependency. Instead, the dependencies would need to be tracked manually by the driver (or, intelligence, or REPL).
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.