Let's write a compiler, part 1: Introduction, selecting a language, and planning
> Outputting to C is a well-recognized compilation strategy.That's true, but it's not a good choice for teaching how to write a compiler because the C compiler does too much of the heavy lifting for you while at the same time imposing unnecessary constraints.  Compiling to C allows you to entirely side-step the question of how to compile arithmetic and function calls, which is like 90% of the battle.  Also, if you want your source language to, for example, be able to do non-local transfers of control or have automatic memory management then you will have to do extra work that you would not have to do if you were compiling to assembler or an abstract RTL.Finally, compiling to C gives the student the impression that there is something holy and immutable about C, that C is The Way and the Truth and the Light and no man comes to the lambda nature but through C.  It's not true, and, to paraphrase Dykstra, the psychological damage caused by indoctrinating people into this worldview is hard to undo.