23 research outputs found
Domain specific language implementation via compile-time meta-programming.
Domain specific languages (DSLs) are mini-languages that are increasingly seen as being a valuable tool for software developers and non-developers alike. DSLs must currently be created in an ad-hoc fashion, often leading to high development costs and implementations of variable quality. In this article, I show how expressive DSLs can be hygienically embedded in the Converge programming language using its compile-time meta-programming facility, the concept of DSL blocks, and specialised error reporting techniques. By making use of pre-existing facilities, and following a simple methodology, DSL implementation costs can be significantly reduced whilst leading to higher quality DSL implementations
Metamorphic Domain-Specific Languages: A Journey Into the Shapes of a Language
External or internal domain-specific languages (DSLs) or (fluent) APIs?
Whoever you are -- a developer or a user of a DSL -- you usually have to choose
your side; you should not! What about metamorphic DSLs that change their shape
according to your needs? We report on our 4-years journey of providing the
"right" support (in the domain of feature modeling), leading us to develop an
external DSL, different shapes of an internal API, and maintain all these
languages. A key insight is that there is no one-size-fits-all solution or no
clear superiority of a solution compared to another. On the contrary, we found
that it does make sense to continue the maintenance of an external and internal
DSL. The vision that we foresee for the future of software languages is their
ability to be self-adaptable to the most appropriate shape (including the
corresponding integrated development environment) according to a particular
usage or task. We call metamorphic DSL such a language, able to change from one
shape to another shape
Formalizing homogeneous language embeddings
The cost of implementing syntactically distinct Domain Specific Languages (DSLs) can
be reduced by homogeneously embedding them in a host language in cooperation with its
compiler. Current homogeneous embedding approaches either restrict the embedding of
multiple DSLs in order to provide safety guarantees, or allow multiple DSLs to be embedded
but force the user to deal with the interoperability burden. In this paper we present the
m-calculus which allows parameterisable language embeddings to be specified and analysed.
By reducing the problem to its core essentials we are able to show how multiple,
expressive language embeddings can be defined in a homogeneous embedding context. We
further show how variant calculi with safety guarantees can be defined
Comparative study of DSL tools.
An increasingly wide range of tools based on different approaches are being used to implement Domain Specific Languages (DSLs), yet there is little agreement as to which approach is, or approaches are, the most appropriate for any given problem. We believe this can in large part be explained by the lack of understanding within the DSL community. In this paper we aim to increase the understanding of the relative strengths and weaknesses of three approaches by implementing a common DSL case study. In addition, we present a comparative study of the three approaches
Formalizing homogeneous language embeddings.
The cost of implementing syntactically distinct Domain Specific Languages (DSLs) can be reduced by homogeneously embedding them in a host language in cooperation with its compiler. Current homogeneous embedding approaches either restrict the embedding of multiple DSLs in order to provide safety guarantees, or allow multiple DSLs to be embedded but force the user to deal with the interoperability burden. In this paper we present the \mu-calculus which allows parameterisable language embeddings to be specified and analysed. By reducing the problem to its core essentials we are able to show how multiple, expressive, language embeddings can be defined in a homogeneous embedding context. We further show how variant calculi with user-defined safety criteria can be defined
Reversible language extensions and their application in debugging
A range of methodologies and techniques are available to guide the design and implementation of language extensions and domainspecific languages. A simple yet powerful technique is based on source-tosource transformations interleaved across the compilation passes of a base language. Despite being a successful approach, it has the main drawback that the input source code is lost in the process. When considering the whole workflow of program development (warning and error reporting, debugging, or even program analysis), program translations are no more powerful than a glorified macro language. In this paper, we propose an augmented approach to language extensions for Prolog, where symbolic annotations are included in the target program. These annotations allow selectively reversing the translated code. We illustrate the approach by
showing that coupling it with minimal extensions to a generic Prolog debugger allows us to provide users with a familiar, source-level view during the debugging of programs which use a variety of language extensions, such as functional notation, DCGs, or CLP{Q,R}
Fine-grained Language Composition: A Case Study
Although run-time language composition is common, it normally takes the form
of a crude Foreign Function Interface (FFI). While useful, such compositions
tend to be coarse-grained and slow. In this paper we introduce a novel
fine-grained syntactic composition of PHP and Python which allows users to
embed each language inside the other, including referencing variables across
languages. This composition raises novel design and implementation challenges.
We show that good solutions can be found to the design challenges; and that the
resulting implementation imposes an acceptable performance overhead of, at
most, 2.6x.Comment: 27 pages, 4 tables, 5 figure
Approaches to Interpreter Composition
In this paper, we compose six different Python and Prolog VMs into 4 pairwise
compositions: one using C interpreters; one running on the JVM; one using
meta-tracing interpreters; and one using a C interpreter and a meta-tracing
interpreter. We show that programs that cross the language barrier frequently
execute faster in a meta-tracing composition, and that meta-tracing imposes a
significantly lower overhead on composed programs relative to mono-language
programs.Comment: 33 pages, 1 figure, 9 table
Domain specific language implementation via compile-time meta-programming.
Domain specific languages (DSLs) are mini-languages that are increasingly seen as being a valuable tool for software developers and non-developers alike. DSLs must currently be created in an ad-hoc fashion, often leading to high development costs and implementations of variable quality. In this article, I show how expressive DSLs can be hygienically embedded in the Converge programming language using its compile-time meta-programming facility, the concept of DSL blocks, and specialised error reporting techniques. By making use of pre-existing facilities, and following a simple methodology, DSL implementation costs can be significantly reduced whilst leading to higher quality DSL implementations
Choosy and Picky: Configuration of Language Product Lines
Although most programming languages naturally share several language features, they are typically implemented as a monolithic product. Language features cannot be plugged and unplugged from a language and reused in another language. Some modular approaches to language construction do exist but composing language features requires a deep understanding of its implementation hampering their use. The choose and pick approach from software product lines provides an easy way to compose a language out of a set of language features. However, current approaches to language product lines are not sufficient enough to cope with the complexity and evolution of real world programming languages. In this work, we propose a general light-weight bottom-up approach to automatically extract a feature model from a set of tagged language components. We applied this approach to the Neverlang language development framework and developed the AiDE tool to guide language developers towards a valid language composition. The approach has been evaluated on a decomposed version of Javascript to highlight the benefits of such a language product line