Java Reference
In-Depth Information
1.6 Programming Language and Compiler Design
Our primary interest is the designand implementationof compilers formodern
programming languages. An interesting aspect of this study is how program-
ming language design and compiler design influence each other. Program-
ming language design obviously influences, and indeed often dictates, how
compilers are crafted. Many clever and sometimes subtle compiler techniques
arise from the need to cope with some programming language construct. A
goodexampleofthisisthe closure mechanism that was invented to handle
formal procedures. A closure is a special runtime representation for a func-
tion. It is usually implemented as a pointer to the function's body and to its
execution environment. While the concept of a closure is attractive from a
programming language design perspective, implementing closures e
ciently
has been challenging for compiler writers [App92, Ken07].
The state of the art in compiler design also strongly a
ects programming
language design, if only because a programming language that cannot be
compiled e
ff
ectively has an uphill road to acceptance. Most successful pro-
gramming language designers (such as the Java language development team)
have extensive compiler design backgrounds.
A programming language that is easy to compile usually has the following
advantages:
ff
It often is easier to learn, read, and understand. If a feature is hard to
compile, it may well be di
cult to understand.
It will have quality compilers on a wide variety of machines. This fact
is often crucial to a language's success. For example, C, C
, Java, and
Fortran are widely available and very popular; Ada and Modula-3 have
limited availability and are far less popular.
++
Often, better code will be generated. Poor-quality code can be fatal in
major applications.
Fewer compiler bugs will occur. If a language cannot be easily under-
stood, then discrepancies will arise in the di
cult regions of the lan-
guage's design. These will in turn lead to compilers that di
ff
er in their
interpretation of a program's meaning.
The compiler will be smaller, cheaper, faster, more reliable, and more
widely used.
Compiler diagnosticmessages andprogramdevelopment toolswill often
be better.
 
 
Search WWH ::




Custom Search