The PhD Thesis of Philipp Kutter [pdf] builds the foundation of Montages. It summarizes a long thread of research started 1997 at Kestrel Institute in Palo Alto. Since then, the thesis has served as white paper for our Tool and Technology development.
The current MCore tool, builds a foundation for realizing the approach described in this thesis, as well as variants of it.
Thesis Title: Montages - Engineering of Computer Languages
Introduction of higher-level programming languages has constantly been the main driving force behind progress in the software industry. While many people knew for instance how to structure their complex software systems in an object-oriented way before they had object oriented programming languages at hand, only the introduction of these languages allowed to spread and reuse this knowledge. Similarly, complex databases have been implemented and queried before the introduction of data-base query languages such as SQL, but only these languages made the technique widely available. The natural evolution towards higher level languages continues, for instance with the uniform modeling
language UML and its executable variants.
The subject of this work is the design of a language that allows to specify new languages in a simple way, and to make the introduction of new languages a common process for software engineers. We call this process language engineering. Language engineering is most interesting if it is applied to small domains, where often a few people know the essential details and where the possibility to spread and reuse their knowledge is vital. The abstractions common to such a domain can typically be captured with new languages constructs, which are then combined with common constructs from well known general-purpose languages. Therefore the main requirements to such a language description formalism are
- ease of use, in order to let the domain-experts participate in the design, as well as
- describability and reuasability of common language features, such as inheritance or exception handling.
In the first part of this work, we discuss the requirements of language engineering and analyze what may be the major obstacle for such an approach in practice.
Based on this analysis, in the second part, we formally define the language description formalism Montages. The semantics of Montages is given as a new kind of state based system, called tree state-machine. The states of a tree state-machine are pairs, composed from a position in the abstract syntax tree of a program, and a state in a classical state-machine, which is associated with the kind of language construct currently processed. States are associated with actions, and intermediate results of the computation are stored in the attributes of the nodes in the syntax tree. It is shown, how such language descriptions can be executed directly, and how alternatively a description can be partially evaluated into a specialized interpreter of the described language. Finally, the specialized interpreter together with a program can be further specialized into an executable version of the program. A number of techniques are introduced to control the form of the generated code.
The last part shows a specification of the Java programming language in order to demonstrate modularity and reusability of the resulting descriptions.
Full Thesis [pdf]