There is a lot of variety when it comes to the different types of programmers. In general, is beneficial for a programmer to learn how to build a compiler? In what cases would
I've up-voted most of these answers.
I think compiler work gives you important ways of thinking about programming in general.
Whenever you write any program you are, in a sense, defining a language, and every program is, at some level, a language processor.
It makes you think about the best way to represent information, and understand that information can be encoded many different ways, not just as data structure and lots of classes.
Once you know that every problem has multiple valid solutions, with pros and cons, you can usually choose a much better solution than with the old data-centered one-size-fits-all paradigm.