Rants, rambles, news and notes from another geek

More About Code Generation

Gordon commented on my post about Code Generation with the following:

_I think the original C++ “Compiler” was actually a C++ preprocessor that outputs C, which then gets compiled in the ordinary way. I think that the CFront C++ compiler works this way as well. _

That is exactly what I was talking about. C++ effectively provided a new level of abstraction on top of C. We were able to write code using these new abstractions (i.e. classes). The C++ “preprocessor” then produced C code which our compiler would turn into machine code. The fact that it happened behind the scenes doesn’t really change the fact that we were using&nbsp_place_holder;a code generator.

I guess we have been using code generators all along, eh?