Java Reference
In-Depth Information
C++
Fortran
Java
C++
Fortran
Java
. . .
. . .
IL
. . .
. . .
Intel
Sparc
MIPS
Intel
Sparc
MIPS
(a)
(b)
Figure 10.3: A middle-end and its ILs simplify construction of a
compiler suite that must support multiple source languages
and multiple target architectures.
An ILs simplifies development and testing of the system's components.
The front- and back-ends can be tested independently by artificially
synthesizing ILs for the back-end until the front-end is ready.
The middle-end contains phases that would otherwise be duplicated
among the front- and back-ends of a compiler suite. Such phases are
generally limited to ILs-to-ILs transformations.
Acarefully designed and suitably formalized ILs allows components and
tools to interface with the ILs-bearing product, either by accepting the
product's ILs as input for some task, or by acting as a surrogate provider
of the ILs.
In a commercial setting, the articulated ILs allows multiple vendors to
share compiler and software toolchain components that can be based on
the ILs.
In a research setting, the ILs can simplify the pioneering and prototyping
of new ideas by providing easy access to the requisite infrastructure.
Consider a compiler writer who wishes to experiment with new ideas for
eliminating computational redundancy. The task of developing a com-
plete compiler from scratch is daunting. However, if the idea can instead
be prototyped using a compiler's ILs, then the expense of writing front-
and back-ends can be avoided. Moreover, if the system is multisource or
multitarget, then deploying the optimization at the ILs-level can obtain
benefits for multiple languages and multiple target platforms.
The ILs and its interpreter can serve as a reference definition of a lan-
guage. Implementation of the interpreter often resolves issues that might
be ambiguous or unclear in the formal specification.
Search WWH ::




Custom Search