Machine-independent intermediate languages

Mark Levine yba at arrow.bellcore.com
Wed Oct 5 01:09:40 AEST 1988


In article <853 at goofy.megatest.UUCP> djones at megatest.UUCP (Dave Jones) writes:
>From article <e2uEl#2ORJzO=eric at snark.UUCP>, by eric at snark.UUCP (Eric S. Raymond):
>Even if it is possible to define a language which will serve as both
>an HLL and an MIIL, (an "MIHLL"), it sure would be nice to have the MIIL 
>to boot strap it with.  Perhaps the MIIL would turn out to be a 
>subset of the HLL with "checking turned off", I dunno.

An old bootstrapping technique I have seen used well is to have a
"virtual machine", say a single stack machine, which you implement on
each target using whatever the best tools on the target allow.  The
bootstrap compiler produces output in the virtual machine's instruction
set, and you write your code generator in the HLL of the compiler
itself, followed by compiling the compiler.  If you happen to produce
RISC machines and put your virtual machine into real hardware, you get
to skip some steps....  Cross-compilers are replaced by implementing
the virtual machine (which is kept deliberately simple).

Is there resistance to the idea of writing the language first, then seeing
what it takes to execute it efficiently, and _then_ designing the hardware?
It seems designers are still fond of assembler, and providing many ways to
do operations for a compiler writer who only needs one fast way.

On the other hand, the LISP machines and the SCHEME chip don't seem to be
setting the world on fire.  What does the current folklore hold?  I have
never really talked with a RISC designer about languages.  I have this
fear they would all want to do an ADA machine first :-).

Eleazor bar Shimon, once and future Carolingian
yba at sabre.bellcore.com



More information about the Comp.lang.c mailing list