Pluggable Compiler

While reading this post about C# 3.0 on MSDN Blogs I thought about an idea to make pluggable compilers. Let me explain:

In every programming language the language designers have to decide which features go into the language and which features stay out. These decisions are crucial to the development of a language and the rate of adoption of it. Once a decision to include a language feature is made, it cannot be undone.

So the idea is to make the compiler pluggable, in the sense that you could include lingual features you’re interested in and exclude others. This could be used to streamline the development style in a team of programmers, for example. In the companies that I have worked for so far, using advanced programming techniques, which were great to use but you had to go through a learning curve to understand, was frowned upon. In production code there’s not always room for creativity at the price of code readability.

A pluggable compiler won’t be easy to make. It will have include a parser, which will know to which compiler plugin it should address when it finds a certain syntax, and different feature syntaxes may interfere with one another. Now I’m wondering if it is even possible to make a plugin-based compiler. Maybe just having the possibility of turning off some language features could be nice. But it’s just an idea.