{"title":"Compiling a reflective language using MetaOCaml","authors":"K. Asai","doi":"10.1145/2658761.2658775","DOIUrl":"https://doi.org/10.1145/2658761.2658775","url":null,"abstract":"A reflective language makes the language semantics open to user programs and allows them to access, extend, and modify it from within the same language framework. Because of its high flexibility and expressiveness, it can be an ideal platform for programming language research as well as practical applications in dynamic environments. However, efficient implementation of a reflective language is extremely difficult. Under the circumstance where the language semantics can change, a partial evaluator is required for compilation. This paper reports on the experience of using MetaOCaml as a compiler for a reflective language. With staging annotations, MetaOCaml achieves the same effect as using a partial evaluator. Unlike the standard partial evaluator, the run mechanism of MetaOCaml enables us to use the specialized (compiled) code in the current runtime environment. On the other hand, the lack of a binding-time analysis in MetaOCaml prohibits us from compiling a user program under modified compiled semantics.","PeriodicalId":404204,"journal":{"name":"International Conference on Generative Programming: Concepts and Experiences","volume":"1 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-05-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"125770366","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Extensible language implementation with object algebras (short paper)","authors":"Maria Gouseti, Chiel Peters, T. Storm","doi":"10.1145/2658761.2658765","DOIUrl":"https://doi.org/10.1145/2658761.2658765","url":null,"abstract":"Object Algebras are a recently introduced design pattern to make the implementation of recursive data types more extensible. In this short paper we report our experience in using Object Algebras in building a realistic domain specific language (DSL) for questionnaires, called QL. This experience has led to a simple, yet powerful set of tools for the practical and flexible implementation of highly extensible languages.","PeriodicalId":404204,"journal":{"name":"International Conference on Generative Programming: Concepts and Experiences","volume":"159 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-05-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"123134072","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Code specialization for memory efficient hash tries (short paper)","authors":"M. Steindorfer, J. Vinju","doi":"10.1145/2658761.2658763","DOIUrl":"https://doi.org/10.1145/2658761.2658763","url":null,"abstract":"The hash trie data structure is a common part in standard collection libraries of JVM programming languages such as Clojure and Scala. It enables fast immutable implementations of maps, sets, and vectors, but it requires considerably more memory than an equivalent array-based data structure. This hinders the scalability of functional programs and the further adoption of this otherwise attractive style of programming. In this paper we present a product family of hash tries. We generate Java source code to specialize them using knowledge of JVM object memory layout. The number of possible specializations is exponential. The optimization challenge is thus to find a minimal set of variants which lead to a maximal loss in memory footprint on any given data. Using a set of experiments we measured the distribution of internal tree node sizes in hash tries. We used the results as a guidance to decide which variants of the family to generate and which variants should be left to the generic implementation. A preliminary validating experiment on the implementation of sets and maps shows that this technique leads to a median decrease of 55% in memory footprint for maps (and 78% for sets), while still maintaining comparable performance. Our combination of data analysis and code specialization proved to be effective.","PeriodicalId":404204,"journal":{"name":"International Conference on Generative Programming: Concepts and Experiences","volume":"24 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-05-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"125122317","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
V. Jovanovic, A. Shaikhha, Sandro Stucki, V. Nikolaev, Christoph E. Koch, Martin Odersky
{"title":"Yin-yang: concealing the deep embedding of DSLs","authors":"V. Jovanovic, A. Shaikhha, Sandro Stucki, V. Nikolaev, Christoph E. Koch, Martin Odersky","doi":"10.1145/2658761.2658771","DOIUrl":"https://doi.org/10.1145/2658761.2658771","url":null,"abstract":"Deeply embedded domain-specific languages (EDSLs) intrinsically compromise programmer experience for improved program performance. Shallow EDSLs complement them by trading program performance for good programmer experience. We present Yin-Yang, a framework for DSL embedding that uses Scala macros to reliably translate shallow EDSL programs to the corresponding deep EDSL programs. The translation allows program prototyping and development in the user friendly shallow embedding, while the corresponding deep embedding is used where performance is important. The reliability of the translation completely conceals the deep em- bedding from the user. For the DSL author, Yin-Yang automatically generates the deep DSL embeddings from their shallow counterparts by reusing the core translation. This obviates the need for code duplication and leads to reliability by construction.","PeriodicalId":404204,"journal":{"name":"International Conference on Generative Programming: Concepts and Experiences","volume":"14 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-05-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"133555473","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Efficient testing of software product lines via centralization (short paper)","authors":"Lei Ma, Cyrille Artho, Cheng Zhang, Hiroyuki Sato","doi":"10.1145/2658761.2658768","DOIUrl":"https://doi.org/10.1145/2658761.2658768","url":null,"abstract":"Software product line~(SPL) engineering manages families of software products that share common features. However, cost-effective test case generation for an SPL is challenging. Applying existing test case generation techniques to each product variant separately may test common code in a redundant way. Moreover, it is difficult to share the test results among multiple product variants. In this paper, we propose the use of centralization, which combines multiple product variants from the same SPL and generates test cases for the entire system. By taking into account all variants, our technique generally avoids generating redundant test cases for common software components. Our case study on three SPLs shows that compared with testing each variant independently, our technique is more efficient and achieves higher test coverage.","PeriodicalId":404204,"journal":{"name":"International Conference on Generative Programming: Concepts and Experiences","volume":"41 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-05-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"124865005","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Projectional editing of variational software","authors":"Eric Walkingshaw, K. Ostermann","doi":"10.1145/2658761.2658766","DOIUrl":"https://doi.org/10.1145/2658761.2658766","url":null,"abstract":"Editing the source code of variational software is complicated by the presence of variation annotations, such as #ifdef statements, and by code that is only included in some configurations. When editing some configurations and not others, it would be easier to edit a simplified version of the source code that includes only the configurations we currently care about. In this paper, we present a projectional editing model for variational software. Using our approach, a programmer can partially configure a variational program, edit this simplified view of the code, and then automatically update the original, fully variational source code. The model is based on an isolation principle where edits affect only the variants that are visible in the view. We show that this principle has several nice properties that are suggested by related work on bidirectional transformations.","PeriodicalId":404204,"journal":{"name":"International Conference on Generative Programming: Concepts and Experiences","volume":"40 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-05-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"114654795","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Christian Humer, Christian Wimmer, Christian Wirth, Andreas Wöß, Thomas Würthinger
{"title":"A domain-specific language for building self-optimizing AST interpreters","authors":"Christian Humer, Christian Wimmer, Christian Wirth, Andreas Wöß, Thomas Würthinger","doi":"10.1145/2658761.2658776","DOIUrl":"https://doi.org/10.1145/2658761.2658776","url":null,"abstract":"Self-optimizing AST interpreters dynamically adapt to the provided input for faster execution. This adaptation includes initial tests of the input, changes to AST nodes, and insertion of guards that ensure assumptions still hold. Such specialization and speculation is essential for the performance of dynamic programming languages such as JavaScript. In traditional procedural and objectoriented programming languages it can be tedious to write selfoptimizing AST interpreters, as those languages fail to provide constructs that would specifically support that. This paper introduces a declarative domain-specific language (DSL) that greatly simplifies writing self-optimizing AST interpreters. The DSL supports specialization of operations based on types of the input and other properties. It can then use these specializations directly or chain them to represent the operation with the minimum amount of code possible. The DSL significantly reduces the complexity of expressing specializations for those interpreters. We use it in our high-performance implementation of JavaScript, where 274 language operations have an average of about 4 and a maximum of 190 specializations. In addition, the DSL is used in implementations of Ruby, Python, R, and Smalltalk.","PeriodicalId":404204,"journal":{"name":"International Conference on Generative Programming: Concepts and Experiences","volume":"65 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-05-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"127452248","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Investigating preprocessor-based syntax errors","authors":"Flávio M. Medeiros, Márcio Ribeiro, Rohit Gheyi","doi":"10.1145/2517208.2517221","DOIUrl":"https://doi.org/10.1145/2517208.2517221","url":null,"abstract":"The C preprocessor is commonly used to implement variability in program families. Despite the widespread usage, some studies indicate that the C preprocessor makes variability implementation difficult and error-prone. However, we still lack studies to investigate preprocessor-based syntax errors and quantify to what extent they occur in practice. In this paper, we define a technique based on a variability-aware parser to find syntax errors in releases and commits of program families. To investigate these errors, we perform an empirical study where we use our technique in 41 program family releases, and more than 51 thousand commits of 8 program families. We find 7 and 20 syntax errors in releases and commits of program families, respectively. They are related not only to incomplete annotations, but also to complete ones. We submit 8 patches to fix errors that developers have not fixed yet, and they accept 75% of them. Our results reveal that the time developers need to fix the errors varies from days to years in family repositories. We detect errors even in releases of well-known and widely used program families, such as Bash, CVS and Vim. We also classify the syntax errors into 6 different categories. This classification may guide developers to avoid them during development.","PeriodicalId":404204,"journal":{"name":"International Conference on Generative Programming: Concepts and Experiences","volume":"32 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2014-03-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"121897356","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"On the simplicity of synthesizing linked data structure operations","authors":"Darya Kurilova, Derek Rayside","doi":"10.1145/2517208.2517225","DOIUrl":"https://doi.org/10.1145/2517208.2517225","url":null,"abstract":"We argue that synthesizing operations on recursive linked data structures is not as hard as it appears and is, in fact, within reach of current SAT-based synthesis techniques - with the addition of a simple approach that we describe to decompose the problem into smaller parts. To generate smaller pieces of code, i.e., shorter routines, is obviously easier than large and complex routines, and, also, there is more potential for automating the code synthesis.\u0000 In this paper, we present a code generation algorithm for synthesizing operations of linked data structures and, as an example, describe how the proposed algorithm works to synthesize operations of an AVL tree.","PeriodicalId":404204,"journal":{"name":"International Conference on Generative Programming: Concepts and Experiences","volume":"3 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2014-03-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"127621762","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Deepak Dhungana, Andreas A. Falkner, Alois Haselböck
{"title":"Generation of conjoint domain models for system-of-systems","authors":"Deepak Dhungana, Andreas A. Falkner, Alois Haselböck","doi":"10.1145/2517208.2517224","DOIUrl":"https://doi.org/10.1145/2517208.2517224","url":null,"abstract":"Software solutions in complex environments, such as railway control systems or power plants, are assemblies of heterogeneous components, which are very large and complex systems themselves. Interplay of these systems requires a thorough design of a system-of-systems (SoS) encompassing the required interactions between the involved systems. One of the challenges lies in reconciliation of the domain data structures and runtime constraints to ensure consistency of the SoS behavior. In this paper, we present a generative approach that enables reconciliation of a common platform based on reusable domain models of the involved systems. This is comparable to a product line configuration problem where we generate a common platform model for all involved systems. We discuss the specific requirements for model composition in a SoS context and address them in our approach. In particular, our approach addresses the operational and managerial independence of the individual systems and offers appropriate modeling constructs. We report on our experiences of applying the approach in several real world projects and share the lessons learned.","PeriodicalId":404204,"journal":{"name":"International Conference on Generative Programming: Concepts and Experiences","volume":"19 2","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2014-03-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"113972132","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}