[Mono-list] Novel Proposal for Mono Compiler Implementations

Bob Salita Bob_Salita@SoftworksLtd.com
Wed, 11 Jul 2001 12:54:43 -0500


>Fergus Henderson wrote:
>parsetree [sic]

Gentle correction. Thank you.

> > The benefits are obvious. Combinations of compiler and emitters still
> > produce traditional code. Nothing changes there. The compiler
> > becomes much simpler to write and the emitters are even simpler.

>Why would the compiler or emitters become simpler to write?

Reduction in complexity. Separation of tasks. Parallel effort.

>I don't see why they would change at all.  After all,
>well-designed compilers already use this structure.

From my previous posting on mono:
Many compilers have a parser and emitter, only they are monolithic. I'm 
unaware of any compiler that (attempts to) meets the Open Compiler tests:

* The compiler creates a publicly exposed parse tree.
* The parse tree is designed to encourage new emitters.
* The parse tree is rich with information to support many types of emitters.
* The parse tree is designed for easy traversal.
* The parse tree is designed for emitters written by non-compiler experts.
* Emitters can easily be plugged in.
* New emitters are not encumbered with IP restrictions.

By these tests, gcc is not an Open Compiler. I welcome comments about these 
tests.

>Only the names would change: what you are calling
>"compiler" and "emitter" are what is often called
>the "front-end" and "back-end" of a compiler.

How people think of compilers would change. Expectations of the tasks a 
compiler could perform would change. How compiler writers structure the 
compiler would change. Adaptability of compilers would change. Marketing of 
compilers would change.

> > First year programmers will be able to write emitters that
> > effectively generate code for whole new architectures.

>You're kidding, right?

>There's a *lot* of work required to go between a parse tree and
>efficient code for a complicated target such as x86 or IA64.

Right. That would be a poor choice of work for a first year student. 
Emitters can do many more tasks than generate assembler, as I and others 
have suggested on this list. It requires a shift in thinking.

Bob.
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com