We present a domain-specific-language (DSL) for writing instances of a class of filter programs. the values in the language are symbolic and independent of a concrete precision. Efficient code generation is required t...
详细信息
ISBN:
(纸本)3540291385
We present a domain-specific-language (DSL) for writing instances of a class of filter programs. the values in the language are symbolic and independent of a concrete precision. Efficient code generation is required to fit the program onto a target device limited in both memory and processing power. We construct an interpreter for the DSL in a language specific to the device which contains the semantics of the target instruction set embedded within a declarative meta-language. the compiler is automatically generated from the interpreter through specialisation. this extension of the instruction set allows the construction of an interpreter for the DSL that is both simple and clear. In particular it allows us to declare static representations of the symbolic values, and have the specialisation of the code produce operate upon these values in the instruction set of the target device.
Extending a programming language by new language constructs often implies extending its compiler by additional machinery. To reduce the complex interweaving of compiler and extension implementations we present a simpl...
详细信息
ISBN:
(纸本)3540291385
Extending a programming language by new language constructs often implies extending its compiler by additional machinery. To reduce the complex interweaving of compiler and extension implementations we present a simple and modular concept of lifting the often needed additional preprocessing out of the base compiler implementation. Avoiding the introduction of standalone tools, this preprocessor framework for extensions of Haskell is designed as a separate portable library of monadic preprocessing functions based on Template Haskell. Additional preprocessing passes expressed in this framework can then much easier be carried along the series of ever advancing base compiler versions. Taking Eden, a parallel programming extension of Haskell, as an example we show that besides achieving improved portability and reusability pass code sizes can be reduced considerably.
We describe the application of generativeprogramming to a problem in interactive information retrieval. the particular interactive information retrieval problem we study is the support for 'out of turn interactio...
详细信息
ISBN:
(纸本)3540291385
We describe the application of generativeprogramming to a problem in interactive information retrieval. the particular interactive information retrieval problem we study is the support for 'out of turn interaction' with a website - how a user can communicate input to a website when the site is not soliciting such information on the current. page, but will do so on a subsequent page. Our solution approach makes generous use of program transformations (partial evaluation, currying, and slicing) to delay the site's current solicitation for input until after the user's out-of-turn input is processed. We illustrate how studying out-of-turn interaction through a generative lens leads to several valuable insights: (i) the concept of a web dialog, (ii) an improved understanding of web taxonomies, and (iii) new web interaction techniques and interfaces. these notions allow us to cast-the design of interactive (and responsive) websites in terms of the underlying dialog structure and, further, suggest a simple implementation strategy with a clean separation of concerns. We also highlight new research directions opened up by the generativeprogramming approach to interactive information retrieval such as the idea of web interaction axioms.
We describe our efforts to use source-level rewriting to optimize run-time program generators written in Jumbo, a run-time program generation system for Java. Jumbo is a compiler written in compositional style, which ...
详细信息
ISBN:
(纸本)3540291385
We describe our efforts to use source-level rewriting to optimize run-time program generators written in Jumbo, a run-time program generation system for Java. Jumbo is a compiler written in compositional style, which brings the advantage that any program fragment can be abstracted out and compiled to an intermediate form. these forms can be put together at run-time to build complete programs. this principle provides a high level of flexibility in writing program generators. However, this comes at the price of inefficient run-time compilation. Using source-level transformations, we optimize the run-time generation of byte code from fragments, achieving speedups of 5-15%. We discuss the optimization process and give several examples.
Domain-specific languages (DSLs) have been proposed as a solution to ease the development of programs within a program family. Sometimes, however, experience withthe use of a DSL reveals the presence of subfamilies w...
详细信息
With Gaussian Elimination as a representative family of numerical and symbolic algorithms, we use multi-stage programming, monads and Ocaml's advanced module system to demonstrate the complete elimination of the a...
详细信息
ISBN:
(纸本)3540291385
With Gaussian Elimination as a representative family of numerical and symbolic algorithms, we use multi-stage programming, monads and Ocaml's advanced module system to demonstrate the complete elimination of the abstraction overhead while avoiding any inspection of the generated code. We parameterize our Gaussian Elimination code to a great extent (over domain, matrix representations, determinant tracking, pivoting policies, result types, etc). at no run-time cost. Because the resulting code is generated just right and not changed afterwards, we enjoy MetaOCaml's guaranty that the generated code is well-typed. We further demonstrate that various abstraction parameters (aspects) can be made orthogonal and compositional, even in the presence of name-generation for temporaries and other bindings and "interleaving" of aspects. We also show how to encode some domain-specific knowledge so that "clearly wrong" compositions can be statically rejected by the compiler when processing the generator rather than the generated code.
Previous work on semantics-based multi-stage programming (MSP) language design focused on homogeneous designs, where the generating and the generated languages are the same. Homogeneous designs simply add a hygienic q...
详细信息
ISBN:
(纸本)3540291385
Previous work on semantics-based multi-stage programming (MSP) language design focused on homogeneous designs, where the generating and the generated languages are the same. Homogeneous designs simply add a hygienic quasi-quotation and evaluation mechanism to a base language. An apparent disadvantage of this approach is that the programmer is bound to boththe expressivity and performance characteristics of the base language. this paper proposes a practical means to avoid this by providing specialized translations from subsets of the base language to different target languages. this approach preserves the homogeneous "look" of multi-stage programs, and, more importantly, the static guarantees about the generated code. In addition, compared to an explicitly heterogeneous approach, it promotes reuse of generator source code and systematic exploration of the performance characteristics of the target languages. To illustrate the proposed approach, we design and implement a translation to a subset of C suitable for numerical computation, and show that it preserves static typing. the translation is implemented, and evaluated with several benchmarks. the implementation is available in the online distribution of MetaOCaml.
Domain-Specific Languages (DSLs) represent a proven approach to raising the abstraction level of programming. they offer high-level constructs and notations dedicated to a domain, structuring program design, easing pr...
详细信息
ISBN:
(纸本)3540291385
Domain-Specific Languages (DSLs) represent a proven approach to raising the abstraction level of programming. they offer high-level constructs and notations dedicated to a domain, structuring program design, easing program writing, masking the intricacies of underlying software layers, and guaranteeing critical properties. On the one hand, DSLs facilitate a straightforward mapping between a conceptual model and a solution expressed in a specific programming language. On the other hand, DSLs complicate the compilation process because of the gap in the abstraction level between the source and target language. the nature of DSLs make their compilation very different from the compilation of common General-Purpose Languages (GPLs). In fact, a DSL compiler generally produces code written in a CPL;low-level compilation is left to the compiler of the target CPL. In essence, a DSL compiler defines some mapping of the high-level information and features of a DSL into the target CPL and underlying layers (e.g., middleware, protocols, objects,...). this paper presents a methodology to develop DSL compilers, centered around the use of generativeprogramming tools. Our approach enables the development of a DSL compiler to be structured on facets that represent dimensions of compilation. Each facet can then be implemented in a modular way, using aspects, annotations and specialization. Because these tools are high level, they match the needs of a DSL, facilitating the development of the DSL compiler, and making it modular and re-targetable. We illustrate our approach with a DSL for telephony services. the structure of the DSL compiler is presented, as well as practical uses of generative, tools for some compilation facets.
this paper presents FEATUREC++, a novel language extension to C++ that supports Feature-Oriented programming (FOP) and Aspect-Oriented programming (AOP). Besides well-known concepts of FOP languages, FEATUREC++ contri...
详细信息
ISBN:
(纸本)3540291385
this paper presents FEATUREC++, a novel language extension to C++ that supports Feature-Oriented programming (FOP) and Aspect-Oriented programming (AOP). Besides well-known concepts of FOP languages, FEATUREC++ contributes several novel FOP language features, in particular multiple inheritance and templates for generic programming. Furthermore, FEATUREC++ solves several problems regarding incremental software development by adopting AOP concepts. Starting our considerations on solving these problems, we give-a summary of drawbacks and weaknesses of current FOP languages in expressing incremental refinements. Specifically, we outline five key problems and present three approaches to solve them: Multi Mixins Aspectual Mixin Layers, and Aspectual Mixins that adopt AOP concepts in different ways. We use FEATUREC++ as a representative FOP language to explain these three approaches. Finally, we present a case study to clarify the benefits of FEATUREC++ and its AOP extensions.
One of the themes in building reusable and maintainable software is identifying similarities and designing generic solutions to unify similarity patterns. In this paper, we analyze capabilities of J2EE to effectively ...
详细信息
ISBN:
(纸本)3540291385
One of the themes in building reusable and maintainable software is identifying similarities and designing generic solutions to unify similarity patterns. In this paper, we analyze capabilities of J2EE to effectively unify similarity patterns found in Web Portals (WP). Our experimentation involved a family of WPs to support information sharing and team collaboration, built by our industry partner. While J2EE provides useful mechanisms for reuse of common services across components, we found its limitations in systematic across-the-board reuse in application domain-specific areas. To solve these problems, we applied a generativeprogramming (GP) technique of XVCL on top of ME By unifying similarity patterns, we increased,the clarity of portal's conceptual structure as perceived by developers, reducing also the size of the original J2EE WP by 61%. Our solution enhanced traceability of information that mattered during changes. Based on that we hypothesized that XVCL-enhanced J2EE WP would be easier to maintain than the original J2EE WP. In the paper, we describe our solution and evaluate its engineering merits in both quantitative and qualitative ways.
暂无评论