180 research outputs found

    Portable reflection for C++ with Mirror

    Get PDF
    Reflection and reflective programming can be used in a broad range of tasks like implementation of serialization operations, remote procedure calls, scripting, automated user interface generation, implementation of several software design patterns, etc. C++ as one of the most prevalent programming languages however, for various reasons, lacks a standardized reflection facility. In this paper we present Mirror - a portable library adding reflection to C++ with a command-line utility automating its usage. This library supports functional style static compile-time reflection and metaprogramming and also provides two different object-oriented run-time polymorphic layers for dynamic reflection

    Precompilation: an alternative approach to provide native generic programming support in C++

    Get PDF
    In C++, Generative Programming (GP) techniques are being used to generate highly customized and optimized products automatically manufactured at compile-time; to provide these functionalities increasing compiling power is required. This work presents an improved compilation model for C++ by adding the ‘precompilation’ phase, leading beyond the Template Meta Programming technique to produce constants and conditional code. Procedural, object-oriented and all the remaining language features become available to produce constants, instances, and compiletime checks, opening, at the same time, a new way for metadata types treatment. In addition to that, when compiling for embedded platforms, some calculi may be moved from resource-critical run time to compile time, taking advantage of the processing power of the host platform. A tool named PRECOMP C++ is also presented in this work as a precompilationenabled C++ extension that supports GP in standard C++ execution during compile time, providing the ability to run metaprograms that operate with more complex data types and features than those supported in Template Meta Programming, such as floating point, pointers arithmetic, inclusion polymorphism, and dynamic memoryII Workshop de Ingeniería de Software y Bases de Datos (WISBD)Red de Universidades con Carreras en Informática (RedUNCI

    Transfuse: A Compile-Time Metaprogramming Solution for Reducing Boilerplate on Google\u27s Android

    Get PDF
    Modern Java application development makes use of metaprogramming to offset and reduce application boilerplate. Unfortunately, metaprogramming techniques typically require a relatively high run-time cost, particularly at application startup. Therefore, environments with limited resources or without the luxury of a warm-up period, often lack metaprogramming as an option. This is precisely the case with applications written for Google Android. Android applications run on low resource mobile hardware and lack an offline startup period. Therefore, Android applications often suffer from a high amount of boilerplate. Fortunately, there is an alternative to the traditional metaprogramming approach. In this thesis, we examine the approach of a metaprogramming tool named Transfuse. Transfuse targets boilerplate reduction within the constraints prescribed by the Android environment. This is accomplished through compile-time analysis and code generation. This approach is analyzed from both boilerplate reduction and run-time performance perspectives

    A Context-Oriented Extension of F#

    Get PDF
    Context-Oriented programming languages provide us with primitive constructs to adapt program behaviour depending on the evolution of their operational environment, namely the context. In previous work we proposed ML_CoDa, a context-oriented language with two-components: a declarative constituent for programming the context and a functional one for computing. This paper describes the implementation of ML_CoDa as an extension of F#.Comment: In Proceedings FOCLASA 2015, arXiv:1512.0694

    Precompilation: an alternative approach to provide native generic programming support in C++

    Get PDF
    In C++, Generative Programming (GP) techniques are being used to generate highly customized and optimized products automatically manufactured at compile-time; to provide these functionalities increasing compiling power is required. This work presents an improved compilation model for C++ by adding the ‘precompilation’ phase, leading beyond the Template Meta Programming technique to produce constants and conditional code. Procedural, object-oriented and all the remaining language features become available to produce constants, instances, and compiletime checks, opening, at the same time, a new way for metadata types treatment. In addition to that, when compiling for embedded platforms, some calculi may be moved from resource-critical run time to compile time, taking advantage of the processing power of the host platform. A tool named PRECOMP C++ is also presented in this work as a precompilationenabled C++ extension that supports GP in standard C++ execution during compile time, providing the ability to run metaprograms that operate with more complex data types and features than those supported in Template Meta Programming, such as floating point, pointers arithmetic, inclusion polymorphism, and dynamic memoryII Workshop de Ingeniería de Software y Bases de Datos (WISBD)Red de Universidades con Carreras en Informática (RedUNCI

    Static and metaprogramming patterns and static frameworks

    Full text link

    Unwoven Aspect Analysis

    Get PDF
    Various languages and tools supporting advanced separation of concerns (such as aspect-oriented programming) provide a software developer with the ability to separate functional and non-functional programmatic intentions. Once these separate pieces of the software have been specified, the tools automatically handle interaction points between separate modules, relieving the developer of this chore and permitting more understandable, maintainable code. Many approaches have left traditional compiler analysis and optimization until after the composition has been performed; unfortunately, analyses performed after composition cannot make use of the logical separation present in the original program. Further, for modular systems that can be configured with different sets of features, testing under every possible combination of features may be necessary and time-consuming to avoid bugs in production software. To solve this testing problem, we investigate a feature-aware compiler analysis that runs during composition and discovers features strongly independent of each other. When the their independence can be judged, the number of feature combinations that must be separately tested can be reduced. We develop this approach and discuss our implementation. We look forward to future programming languages in two ways: we implement solutions to problems that are conceptually aspect-oriented but for which current aspect languages and tools fail. We study these cases and consider what language designs might provide even more information to a compiler. We describe some features that such a future language might have, based on our observations of current language deficiencies and our experience with compilers for these languages
    corecore