Replication can be used to increase the availability of a service by creating many operational copies of its data called replicas. Active replication is a form of replication that has strong consistency semantics, easier to reason about and program. However, creating replicated services using active replication still demands from the programmer the knowledge of subtleties of the replication mechanism. In this paper we show how to use the metaprogramming infrastructure of the Cyan language to shield the application programmer from these details, allowing easier creation of fault-tolerant replicated applications through simple annotations.
{"title":"Transparent Replication Using Metaprogramming in Cyan","authors":"Fellipe A. Ugliara, G. M. D. Vieira, J. Guimarães","doi":"10.1145/3125374.3125375","DOIUrl":"https://doi.org/10.1145/3125374.3125375","url":null,"abstract":"Replication can be used to increase the availability of a service by creating many operational copies of its data called replicas. Active replication is a form of replication that has strong consistency semantics, easier to reason about and program. However, creating replicated services using active replication still demands from the programmer the knowledge of subtleties of the replication mechanism. In this paper we show how to use the metaprogramming infrastructure of the Cyan language to shield the application programmer from these details, allowing easier creation of fault-tolerant replicated applications through simple annotations.","PeriodicalId":430395,"journal":{"name":"Proceedings of the 21st Brazilian Symposium on Programming Languages","volume":"138 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2017-09-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"123839199","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}
Junio Cezar R. da Silva, Fernando Magno Quintão Pereira
A less-than analysis is a technique used by compilers to build a partial ordering between the integer variables in a program. Recently, researchers have shown how to use less-than information to improve the precision of alias analyses. The literature describes two techniques to build less-than relations. Both are asymptotically equivalent to computing a transitive closure in a graph. In this paper, we depart from this approach, and introduce an algorithm that builds less-than relations on demand. We claim that such algorithm is more adequate than the current state-of-the-art approaches, as it performs only the necessary work to satisfy the needs of its clients, i.e., alias analyses and optimizations that require less-than information. To validate our idea, we have implemented it onto the LLVM compilation infrastructure. Depending on the client analysis, our implementation may lead to runtime savings of up to 68% on large benchmarks, when compared to the more traditional approach based on the construction of the transitive closure.
{"title":"Demand-driven less-than analysis","authors":"Junio Cezar R. da Silva, Fernando Magno Quintão Pereira","doi":"10.1145/3125374.3125379","DOIUrl":"https://doi.org/10.1145/3125374.3125379","url":null,"abstract":"A less-than analysis is a technique used by compilers to build a partial ordering between the integer variables in a program. Recently, researchers have shown how to use less-than information to improve the precision of alias analyses. The literature describes two techniques to build less-than relations. Both are asymptotically equivalent to computing a transitive closure in a graph. In this paper, we depart from this approach, and introduce an algorithm that builds less-than relations on demand. We claim that such algorithm is more adequate than the current state-of-the-art approaches, as it performs only the necessary work to satisfy the needs of its clients, i.e., alias analyses and optimizations that require less-than information. To validate our idea, we have implemented it onto the LLVM compilation infrastructure. Depending on the client analysis, our implementation may lead to runtime savings of up to 68% on large benchmarks, when compared to the more traditional approach based on the construction of the transitive closure.","PeriodicalId":430395,"journal":{"name":"Proceedings of the 21st Brazilian Symposium on Programming Languages","volume":"38 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2017-09-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"114708485","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}
Marco Couto, Rui Pereira, Francisco Ribeiro, Rui Rua, J. Saraiva
While in the past the primary goal to optimize software was the run time optimization, nowadays there is a growing awareness of the need to reduce energy consumption. Additionally, a growing number of developers wish to become more energy-aware when programming and feel a lack of tools and the knowledge to do so. In this paper we define a ranking of energy efficiency in programming languages. We consider a set of computing problems implemented in ten well-known programming languages, and monitored the energy consumed when executing each language. Our preliminary results show that although the fastest languages tend to be the lowest consuming ones, there are other interesting cases where slower languages are more energy efficient than faster ones.
{"title":"Towards a Green Ranking for Programming Languages","authors":"Marco Couto, Rui Pereira, Francisco Ribeiro, Rui Rua, J. Saraiva","doi":"10.1145/3125374.3125382","DOIUrl":"https://doi.org/10.1145/3125374.3125382","url":null,"abstract":"While in the past the primary goal to optimize software was the run time optimization, nowadays there is a growing awareness of the need to reduce energy consumption. Additionally, a growing number of developers wish to become more energy-aware when programming and feel a lack of tools and the knowledge to do so. In this paper we define a ranking of energy efficiency in programming languages. We consider a set of computing problems implemented in ten well-known programming languages, and monitored the energy consumed when executing each language. Our preliminary results show that although the fastest languages tend to be the lowest consuming ones, there are other interesting cases where slower languages are more energy efficient than faster ones.","PeriodicalId":430395,"journal":{"name":"Proceedings of the 21st Brazilian Symposium on Programming Languages","volume":"33 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2017-09-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"128313481","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}
João F. N. Carvalho, B. L. Sousa, Marcus R. Araújo, Mariza Bigonha
Both register allocation and instruction scheduling are old and open issues in Computer Science, despite the efforts already made to address them separate or jointly. Register allocation may be seen as having two parts: allocation, which decides which values should be in registers, and assignment, which assigns a specific register to each value. Instruction scheduling aims at identifying and moving the instructions in the code, changing their original execution sequence, so that they may run in parallel. Register allocation and instruction scheduling attempt to minimize the execution time of the program, however, they are interdependent and are involved in a prioritization problem. This paper presents a Systematic Literature Review (SLR) related to this problem. From a total of 542 primary studies initially obtained on six databases, 25 studies closely related to this research theme were identified, 12 of them published between 2000 and October 2016. These studies were analyzed to answer the research questions proposed in this SLR, producing useful informations about this theme and about the approaches that, traditionally, have been used to solving this problem. An important finding of this research is the confirmation that this problem still has no definitive solution, and continues to be a relevant challenge for developers, since its solution is closely linked to the quality of the code generated by the compilers in general.
{"title":"The Register Allocation and Instruction Scheduling Challenge","authors":"João F. N. Carvalho, B. L. Sousa, Marcus R. Araújo, Mariza Bigonha","doi":"10.1145/3125374.3125380","DOIUrl":"https://doi.org/10.1145/3125374.3125380","url":null,"abstract":"Both register allocation and instruction scheduling are old and open issues in Computer Science, despite the efforts already made to address them separate or jointly. Register allocation may be seen as having two parts: allocation, which decides which values should be in registers, and assignment, which assigns a specific register to each value. Instruction scheduling aims at identifying and moving the instructions in the code, changing their original execution sequence, so that they may run in parallel. Register allocation and instruction scheduling attempt to minimize the execution time of the program, however, they are interdependent and are involved in a prioritization problem. This paper presents a Systematic Literature Review (SLR) related to this problem. From a total of 542 primary studies initially obtained on six databases, 25 studies closely related to this research theme were identified, 12 of them published between 2000 and October 2016. These studies were analyzed to answer the research questions proposed in this SLR, producing useful informations about this theme and about the approaches that, traditionally, have been used to solving this problem. An important finding of this research is the confirmation that this problem still has no definitive solution, and continues to be a relevant challenge for developers, since its solution is closely linked to the quality of the code generated by the compilers in general.","PeriodicalId":430395,"journal":{"name":"Proceedings of the 21st Brazilian Symposium on Programming Languages","volume":"90 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2017-09-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"130196631","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}
In this paper we mechanize in Coq a typed, call-by-value language by specifying its operational semantics and giving intrinsic and extrinsic denotational semantics, both using domain theory. We also prove that the denotational semantics are equivalent; this is interesting because it leads to a direct proof of coherence for the intrinsic semantics. Finally, we prove the adequacy of the operational semantics with respect to the denotational semantics. As far as we know, this is the first mechanization of Reynolds' bracketing theorem and also the use of biorthogonality with extrinsic semantics instead of intrinsic semantics.
{"title":"The importance of being Extrinsic: Coherence and adequacy for a call-by-value language","authors":"Alejandro Gadea, Emmanuel Gunther, Miguel Pagano","doi":"10.1145/3125374.3125378","DOIUrl":"https://doi.org/10.1145/3125374.3125378","url":null,"abstract":"In this paper we mechanize in Coq a typed, call-by-value language by specifying its operational semantics and giving intrinsic and extrinsic denotational semantics, both using domain theory. We also prove that the denotational semantics are equivalent; this is interesting because it leads to a direct proof of coherence for the intrinsic semantics. Finally, we prove the adequacy of the operational semantics with respect to the denotational semantics. As far as we know, this is the first mechanization of Reynolds' bracketing theorem and also the use of biorthogonality with extrinsic semantics instead of intrinsic semantics.","PeriodicalId":430395,"journal":{"name":"Proceedings of the 21st Brazilian Symposium on Programming Languages","volume":"25 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2017-09-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"126558193","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}
Extensible records are records structures that can be dynamically extended with new fields. In some languages, extensible records are supported as a primitive, in others they are implemented as a user library, each alternative with its benefits and drawbacks. This paper presents a library to strongly-typed extensible records in Idris, a functional programming language with dependent types. Like HList, a Haskell library for extensible records, we use heterogeneous lists to represent our records, but now exploiting the power of dependent types. We show the benefits of our solution by means of examples.
{"title":"Extensible records in Idris","authors":"Gonzalo Waszczuk, Alberto Pardo, Marcos Viera","doi":"10.1145/3125374.3125384","DOIUrl":"https://doi.org/10.1145/3125374.3125384","url":null,"abstract":"Extensible records are records structures that can be dynamically extended with new fields. In some languages, extensible records are supported as a primitive, in others they are implemented as a user library, each alternative with its benefits and drawbacks. This paper presents a library to strongly-typed extensible records in Idris, a functional programming language with dependent types. Like HList, a Haskell library for extensible records, we use heterogeneous lists to represent our records, but now exploiting the power of dependent types. We show the benefits of our solution by means of examples.","PeriodicalId":430395,"journal":{"name":"Proceedings of the 21st Brazilian Symposium on Programming Languages","volume":"27 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2017-09-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"116641384","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}
Many programs have crosscutting concerns for which neither procedural nor object-oriented programming adequately modularize, which has led to the idea of aspect-oriented programming (AOP). However, AOP has not found favor with the programming languages community due to a belief that AOP breaks classical modularity and modular reasoning. We propose a new AOP programming model that enables both crosscutting modularity and modular reasoning. This model is implemented by AspectJML, a general-purpose aspect-oriented extension to Java. It supports modular crosscutting concerns using key object-oriented mechanisms, such as hierarchical structure, and allows reasoning that scales to ever-larger programs.
{"title":"Aspect-Oriented Programming Reloaded","authors":"Henrique Rebêlo, Gary T. Leavens","doi":"10.1145/3125374.3125383","DOIUrl":"https://doi.org/10.1145/3125374.3125383","url":null,"abstract":"Many programs have crosscutting concerns for which neither procedural nor object-oriented programming adequately modularize, which has led to the idea of aspect-oriented programming (AOP). However, AOP has not found favor with the programming languages community due to a belief that AOP breaks classical modularity and modular reasoning. We propose a new AOP programming model that enables both crosscutting modularity and modular reasoning. This model is implemented by AspectJML, a general-purpose aspect-oriented extension to Java. It supports modular crosscutting concerns using key object-oriented mechanisms, such as hierarchical structure, and allows reasoning that scales to ever-larger programs.","PeriodicalId":430395,"journal":{"name":"Proceedings of the 21st Brazilian Symposium on Programming Languages","volume":"18 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2017-09-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"133909839","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}
We describe the formalization of a regular expression (RE) parsing algorithm that produces a bit representation of its parse tree in the dependently typed language Agda. The algorithm computes bit-codes using Brzozowski derivatives and we prove that produced codes are equivalent to parse trees ensuring soundness and completeness w.r.t an inductive RE semantics. We include the certified algorithm in a tool developed by us, named verigrep, for regular expression based search in the style of the well known GNU grep. Practical experiments conducted with this tool are reported.
{"title":"Certified Bit-Coded Regular Expression Parsing","authors":"R. Ribeiro, A. R. D. Bois","doi":"10.1145/3125374.3125381","DOIUrl":"https://doi.org/10.1145/3125374.3125381","url":null,"abstract":"We describe the formalization of a regular expression (RE) parsing algorithm that produces a bit representation of its parse tree in the dependently typed language Agda. The algorithm computes bit-codes using Brzozowski derivatives and we prove that produced codes are equivalent to parse trees ensuring soundness and completeness w.r.t an inductive RE semantics. We include the certified algorithm in a tool developed by us, named verigrep, for regular expression based search in the style of the well known GNU grep. Practical experiments conducted with this tool are reported.","PeriodicalId":430395,"journal":{"name":"Proceedings of the 21st Brazilian Symposium on Programming Languages","volume":"96 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2017-09-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"114316932","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}
Monads are a denotational approach to embed and reason about notions of computation such as mutable state, I/O, exceptions, and many others. Even though monads are technically language-agnostic, they are mostly associated to the Haskell language. Indeed, one could argue that the use of monads is one of the defining characteristic of the Haskell language. In practical terms, monadic programming in Haskell relies on the standard mtl package library, which provides 8 notions of computation: identity, error, list, state, reader, writer, RWS, and continuations. Despite their widespread use, we are not aware of any empirical investigations regarding how developers use monads. In this paper we present preliminary results of an empirical study that quantitatively describe how monads are used in a sample of the Hackage repository. Our results show that around 25% of sampled modules depend on the mtl package, whereas only 1% depend on alternative, yet compatible implementations. Nevertheless, usage patterns for each specific monad remain similar both for mtl and alternatives. Regarding usage, the state monad is by far the most used one, although all of them are used. We also report on the distribution of packages that use mtl, regarding their category and stability level.
{"title":"A preliminary assessment of how monads are used in Haskell","authors":"Ismael Figueroa","doi":"10.1145/3125374.3125385","DOIUrl":"https://doi.org/10.1145/3125374.3125385","url":null,"abstract":"Monads are a denotational approach to embed and reason about notions of computation such as mutable state, I/O, exceptions, and many others. Even though monads are technically language-agnostic, they are mostly associated to the Haskell language. Indeed, one could argue that the use of monads is one of the defining characteristic of the Haskell language. In practical terms, monadic programming in Haskell relies on the standard mtl package library, which provides 8 notions of computation: identity, error, list, state, reader, writer, RWS, and continuations. Despite their widespread use, we are not aware of any empirical investigations regarding how developers use monads. In this paper we present preliminary results of an empirical study that quantitatively describe how monads are used in a sample of the Hackage repository. Our results show that around 25% of sampled modules depend on the mtl package, whereas only 1% depend on alternative, yet compatible implementations. Nevertheless, usage patterns for each specific monad remain similar both for mtl and alternatives. Regarding usage, the state monad is by far the most used one, although all of them are used. We also report on the distribution of packages that use mtl, regarding their category and stability level.","PeriodicalId":430395,"journal":{"name":"Proceedings of the 21st Brazilian Symposium on Programming Languages","volume":"26 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2017-09-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"122528815","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}
Gesture-based systems are becoming an alternative to the development of intuitive applications for users because they enable them to interact more naturally. In general, such systems use tracking devices together with code to recognize the gestures, which often involves complex implementations. Furthermore, due to the nature of Software Development Kits provided by hardware vendors, the code becomes dependent on the tracking device. Hence, significant portions of the application need to be rewritten in order to run on another device. In this work, we propose the use of a Domain Specific Language to reduce the complexity of specification and recognition of gestures. We also provide a hardware abstraction layer that standardizes the capture of the sensorsfi raw data. This allows any gesture definition to become independent from the device. We conclude by presenting an experiment that evaluates the usage of the language to specify and recognize a large variety of gestures. The results show a reduction in the complexity for specifying and recognizing gestures.
{"title":"A Domain-Specific Language for the Specification of Gesture-based Applications","authors":"D. L. Viana, André L. M. Santos","doi":"10.1145/3125374.3125376","DOIUrl":"https://doi.org/10.1145/3125374.3125376","url":null,"abstract":"Gesture-based systems are becoming an alternative to the development of intuitive applications for users because they enable them to interact more naturally. In general, such systems use tracking devices together with code to recognize the gestures, which often involves complex implementations. Furthermore, due to the nature of Software Development Kits provided by hardware vendors, the code becomes dependent on the tracking device. Hence, significant portions of the application need to be rewritten in order to run on another device. In this work, we propose the use of a Domain Specific Language to reduce the complexity of specification and recognition of gestures. We also provide a hardware abstraction layer that standardizes the capture of the sensorsfi raw data. This allows any gesture definition to become independent from the device. We conclude by presenting an experiment that evaluates the usage of the language to specify and recognize a large variety of gestures. The results show a reduction in the complexity for specifying and recognizing gestures.","PeriodicalId":430395,"journal":{"name":"Proceedings of the 21st Brazilian Symposium on Programming Languages","volume":"33 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2017-09-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"124450831","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}