We often think about a compiler as a black box which produces an output from an input. Compilers were generally written in C++ because of speed, custom memory, file, and thread management needs. For example, the C# compiler takes .cs files in input and generates .dll files in output.
Now the new Microsoft compiler written in C# and VB, Roslyn, is not just a compiler; it's a .NET compiler platform that we can extend.