One question that I always pondered, and actually got me thinking about entering in a computer science degree is how does one write a compiler/code program such as VB or C++, because in essence, you are writing a program that writes a program.

So, how is it done?