@ker thanks for starting this thread and for the explanations
My worry here is that we are adding yet another ad hoc way to plug in to the compiler and at a very early stage in the development of MIR. The current plugin mechanism is grotty and I am pretty sure we will want to change it in the long run, adding more uses of it make that harder.
I would be happy with having the MIR plugin stuff on an unstable and somewhat temporary basis, with the understanding that when we do reform plugins there will be a lot of breakage. Furthermore, once we move syntax extensions away from the registry model, we might want to remove the registry, breaking LLVM and MIR plugins with no immediate replacement (I don’t think we would do this because I don’t see a strong motivation at this stage, but I want it to be a possible course of action if necessary).
I do get very worried about any plugin mechanism to the compiler becoming de facto stable due to use by tools. This could adversely affect development of the MIR and a long term plugin solution.
I’m a little uncomfortable with lints in general - they make use of unstable compiler internals and I don’t see a way forward to making them work stably. I think they are an important tool, and I would love to have more of a sense of a good solution for them. Adding another kind of lint without having a proper vision for lints makes me very nervous.
@nagisa
llvm plugin passes were added basically because someone wanted one, they’re annoying because they are used in two places which is just enough to prevent getting rid of the code, but not enough to justify the code really being there. Furthermore, they are not documented at all, so anyone wanting to actually implement a plugin llvm pass is pretty stuck. I really don’t want to repeat that experience.