Abstract

In this tool demonstration of Silver extensible compiler frameworks for Java and C we illustrate how new languages that are adapted to specific problem domains can be easily created, by their users, by importing a set of desired domain-specific language extensions into an extensible host language compiler. Language extensions for computational geometry and database access will be shown. We also show extensions that provide general purpose language features such as algebraic types and pattern matching can be imported into an extensible language compiler. Each Silver extensible compiler framework supports the development of language extensions that have two important facets. First, language extensions should satisfy a completeness requirement. That is, they should be as welldeveloped as host language features and fit seamlessly into the host language. In particular, the language feature designer should be able to specify new language constructs together with their domain-specific semantic analyses and techniques for their optimization. One aspect of this requirement is that language extension should report a useful error message when they are used incorrectly. Second, the extensions should be modular so that a programmer can extend his or her language by choosing from a collection of previously defined features knowing only the functionality they provide and with no implementation-level knowledge or a detailed analysis of their interactions. Thus we draw a distinction between the programmer importing an extension and the feature designer who implements it. We will show extensible compilers for both C and Java. These compilers are defined by an attribute grammar written in the Silver attribute grammar language. A Silver compiler analyses attribute grammar specifications and generates an executable compiler for the defined (extended) language by translating the Silver specifications into an efficient Haskell representation. Language extensions are also specified as Silver attribute grammar fragments and the framework tools automatically compose specifications of the host language and chosen language extensions into a specification for the custom extended language.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call