Thursday, June 27, 2002

C-- Home Welcome to C--
Suppose you are writing a compiler; how will you get quality machine code? Writing your own code generator is a lot of work, so you might use somebody else's. There appear to be three notable, freely available code generators: VPO, MLRISC, and the gcc back end. Each of these impressive systems has a rich, complex, and ill-documented interface---and once you start to use one, you will be unable to switch easily to another. Furthermore, to use MLRISC you must write your front end in ML, to use gcc you must write it in C, and so on.
You might also generate C, if you can afford its calling conventions. And forget about proper tail calls, computed gotos, accurate garbage collection, efficient exceptions, or source-level debugging.
All of this is most unsatisfactory. It would be much better to have one portable assembly language that could be generated by a front end and implemented by any of the available code generators. Such a language should serve as the interface between high-level compilers and retargetable, optimizing code generators. Life would be easier for compiler writers, and authors of code generators would have customers instantly. C-- is that language.

0 Comments:

Post a Comment

<< Home