Phobos: A front-end approach to extensible compilers (long version (original) (raw)
Related papers
Phobos: a front-end approach to extensible compilers
36th Annual Hawaii International Conference on System Sciences, 2003. Proceedings of the, 2003
This paper describes a practical approach for implementing certain types of domain-specific languages with extensible compilers. Given a compiler with one or more front-end languages, we introduce the idea of a "generic" front-end that allows the syntactic and semantic specification of domain-specific languages. Phobos, our generic front-end, offers modular language specification, allowing the programmer to define new syntax and semantics incrementally.
Incremental concrete syntax for embedded languages
2011
Embedded domain-specific languages (EDSLs) are known to improve the productivity of developers. However, for many domains no DSL implementation is available and two important reasons for this are: First, the effort to implement EDSLs that provide the domain's established syntax (called concrete syntax) is very high. Second, the EDSL and its underlying general-purpose programming language (GPL) are typically tightly integrated. This hampers reusability across different GPLs. Besides these implementation issues, the productivity gains of using EDSLs are also limited by the lack of explicit tool support for EDSL users-such as syntax highlighting or code analyses. In this paper, we present an approach that significantly reduces the necessary effort to implement embedded DSLs with concrete syntax. The idea is to use island grammars to specify the EDSL's concrete syntax. This enables the developer to implement the embedded DSL as a library and to incrementally specify the concrete syntax using meta-data. Only those parts of the EDSL's grammar need to be specified that deviate from the grammar of the GPL. By analyzing an EDSL's implementation using reflection, it is possible to provide tool support for EDSLs without having the developer implement it explicitly, such as syntax highlighting. An evaluation demonstrates the feasibility of our approach by embedding a real-world DSL into a GPL.
Dynamic semantics for language-based programming environments revisited
1999
Abstract Montages are a semi-visual language specification formalism recently proposed by some of the authors. This framework has been successfully used to give complete executable specifications of languages like C and Java. This paper compares Montages with action equations, both being paradigms for incorporating a means for specifying dynamic semantics in an environment generator using an attribute grammar framework.
Incremental concrete syntax for embedded languages with support for separate compilation
Science of Computer Programming, 2013
Embedded domain-specific languages (EDSLs) are known to improve the productivity of developers. However, for many domains no DSL implementation is available and two important reasons for this are: First, the effort to implement EDSLs that provide the domain's established syntax (called concrete syntax) is very high. Second, the EDSL and its underlying general-purpose programming language (GPL) are typically tightly integrated. This hampers reusability across different GPLs. Besides these implementation issues, the productivity gains of using EDSLs are also limited by the lack of explicit tool support for EDSL users-such as syntax highlighting or code analyses. In this paper, we present an approach that significantly reduces the necessary effort to implement embedded DSLs with concrete syntax. The idea is to use island grammars to specify the EDSL's concrete syntax. This enables the developer to implement the embedded DSL as a library and to incrementally specify the concrete syntax using meta-data. Only those parts of the EDSL's grammar need to be specified that deviate from the grammar of the GPL. By analyzing an EDSL's implementation using reflection, it is possible to provide tool support for EDSLs without having the developer implement it explicitly, such as syntax highlighting. An evaluation demonstrates the feasibility of our approach by embedding a real-world DSL into a GPL.
A comparison of two metacompilation approaches to implementing a complex domain-specific language
Proceedings of the 27th Annual ACM Symposium on Applied Computing - SAC '12, 2012
Operational semantics and attribute grammars are examples of formalisms that can be used for generating compilers. We are interested in finding similarities and differences in how these approaches are applied to complex languages, and for generating compilers of such maturity that they have users in industry.
On Embedding Domain-specific Languages with User-friendly Syntax
2006
I present ZyTyG, a strategy to define domain-specific languages with a user-friendly syntax. This strategy does not requires any pre-processor or meta-programming facility and only relies on features provided by the object-oriented host language. I describe its application to ScalaDBC, a database library with an embedded DSL to encode queries in SQL-like syntax and that uses this strategy.
MontiCore: Modular Development of Textual Domain Specific Languages
Lecture Notes in Business Information Processing, 2008
Reuse is a key technique for a more efficient development and ensures the quality of the results. In object technology explicit encapsulation, interfaces, and inheritance are well-known principles for independent development that enable combination and reuse of developed artifacts. In this paper we apply modularity concepts for domain specific languages (DSLs) and discuss how they help to design new languages by extending existing ones and composing fragments to new DSLs. We use an extended grammar format with appropriate tool support that avoids redefinition of existing functionalities by introducing language inheritance and embedding as first class artifacts in a DSL definition. Language embedding and inheritance is not only assisted by the parser, but also by the editor, and algorithms based on tree traversal like context checkers, pretty printers, and code generators. We demonstrate that compositional engineering of new languages becomes a useful concept when starting to define project-individual DSLs using appropriate tool support.