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.
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) 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.
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.
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.
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.
component-oriented programming yields a tension between higher-order features (deployment, reconfiguration, passivation), encapsulation, and component sharing. We propose a discipline for component-oriented programmin...
详细信息
Code generators based on template expansion techniques are easier to build than purely deductive systems but do not guarantee the same level of assurance: instead of providing "coffectness-by-construction", ...
详细信息
ISBN:
(纸本)3540291385
Code generators based on template expansion techniques are easier to build than purely deductive systems but do not guarantee the same level of assurance: instead of providing "coffectness-by-construction", the correctness of the generated code depends on the correctness of the generator itself. We present an alternative assurance approach, in which the generator is extended to enable Hoare-style safety proofs for each individual generated program. the proofs ensure that the generated code does not "go wrong", i.e., does not violate certain conditions during its execution. the crucial step in this approach is to extend the generator in such way that it produces all required annotations (i.e., pre-/postconditions and loop invariants) without compromising the assurance provided by the subsequent verification phase. this is achieved by embedding annotation templates into the code templates, which are then instantiated in parallel by the generator. this is feasible because the structure of the generated code and the possible safety properties are known when the generator is developed. It does not compromise the provided assurance because the annotations only serve as auxiliary lemmas and errors in the annotation templates ultimately lead to unprovable safety obligations. We have implemented this approach and integrated it into the AUTOBAYES and AUToFILTER program generators. We have then used it to, fully automatically prove that code generated by the two systems satisfies both language-specific properties such as array-bounds safety or proper variable initialization-before-use and domain-specific properties such as vector normalization, matrix symmetry, or correct sensor input usage.
this paper presents AOP++, a generic aspect-oriented programming framework in C++. It successfully incorporates AOP with object-oriented programming as well as generic programming naturally in the framework of standar...
详细信息
abc is an extensible, optimising compiler for AspectJ. It has been designed as a workbench for experimental research in aspect-oriented programming languages and compilers. We outline a programme of research in these ...
详细信息
暂无评论