Open
Description
We've been talking a few times already about running the optimizer separately from compilation, let's collect the thoughts here.
This obviously overlaps with @DarkDimius' work on the dotty linker, and is similar to Scala.js' linker.
The idea is to run the Scala inliner and optimizer separately from compilation in 2.13, in a linking step. Some advantages
- The classpath is known. When using the 2.12 compile-time optimizer, it's up to the user to make sure that the compile-time classspath has exactly the same versions as the one at run-time.
- Better optimizations, for example through static class hierarchy analysis.
Instead of writing a new tool, it might make sense to work with the dotty linker, @DarkDimius has certainly given that some thought already (would we need to emit TASTY?).