The question is whether Dotty is useful for this or is it better to use something like ScalaMeta that is directly targeted towards this problem.
In case you decide to re-implement patter-matching\mixin\flatten\lambdalift\etc in your analysis, you'll need to make sure they behave the same as the implementation in Dotty. It's actually worse, as you'll need to track changes in Dotty in case bugs are fixed or behavior is changed.
If you do transformations\optimizations, you may want to run in Dotty because compiler can create expressions that users can't write.
For example, it would be hard to make pattern matching implemented outside of Dotty efficient.
Best,
Dmitry
Is there documentation on how to interfere with the compiler for this kind of meta-programming work, oris it a "read-the-code" kind of activity at this early stage?
Note that Dotty currently does not have plugin infrastructure or public API that would be useful for you. You'll have to either fork dotty or create your own `main`. At the same time, the internal design of Dotty has been quite stable for last several years. E.g. the phases & trees remain unchanged for last 2.5 years.
Best,
Dmitry
Many thanks for your useful answer!