Cookies Policy
The website need some cookies and similar means to function. If you permit us, we will use those means to collect data on your visits for aggregated statistics to improve our service. Find out More
Accept Reject
  • Menu
Publications

Publications by HASLab

2024

Tabulation with Zippers

Authors
Viera, M; Pardo, A; Saraiva, J;

Publication
FUNCTIONAL AND LOGIC PROGRAMMING, FLOPS 2024

Abstract
Tabulation is a well-known technique for improving the efficiency of recursive functions with redundant function calls. A key point in the application of this technique is to identify a suitable representation for the table. In this paper, we propose the use of zippers as tables in the tabulation process. Our approach relies on a generic function zipWithZipper, that makes strong use of lazy evaluation to traverse two zippers in a circular manner. The technique turns out to be particularly efficient when the arguments to recursive calls are closely situated within the function domain. For example, in the case of natural numbers this means function calls on fairly contiguous values. Likewise, when dealing with tree structures, it means functions calls on immediate sub-trees and parent nodes. This results in a concise and efficient zipper-based embedding of attribute grammars.

2024

Programming languages ranking based on energy measurements

Authors
Gordillo, A; Calero, C; Moraga, MA; García, F; Fernandes, JP; Abreu, R; Saraiva, J;

Publication
SOFTWARE QUALITY JOURNAL

Abstract
Software is developed using programming languages whose choice is made based on a wide range of criteria, but it should be noted that the programming language selected can affect the quality of the software product. In this paper, we focus on analysing the differences in energy consumption when running certain algorithms that have been developed using different programming languages. Therefore, we focus on the software quality from the perspective of greenability, in concrete in the aspects related to energy efficiency. For this purpose, this study has conducted an empirical investigation about the most suitable programming languages from an energy efficiency perspective using a hardware-based consumption measurement instrument that obtains real data about energy consumption. The study builds upon a previous study in which energy efficiency of PL were ranked using a software-based approach where the energy consumption is an estimation. As a result, no significant differences are obtained between two approaches, in terms of ranking the PL. However, if it is required to have a more realistic knowledge of consumption, it is necessary to use hardware approaches. Furthermore, the hardware approach provides information about the energy consumption of specific DUT hardware components, such as, HDD, graphics card, and processor, and a ranking for each of component is elaborated. This can provide useful information to make a more informed decision on the choice of a PL, depending on several factors, such as the type of algorithms to be implemented, or the effects on power consumption not only in overall, but also depending on specific DUT hardware components.

2024

Embracing modern C plus plus features: An empirical assessment on the KDE community

Authors
Lucas, W; Carvalho, F; Nunes, RC; Bonifácio, R; Saraiva, J; Accioly, P;

Publication
JOURNAL OF SOFTWARE-EVOLUTION AND PROCESS

Abstract
Similar to software systems, programming languages evolve substantially over time. Indeed, the community has more recently seen the release of new versions of mainstream languages in shorter and shorter time frames. For instance, the C++ working group has begun to release a new version of the language every 3 years, which now has a greater number of modern C++ features and improvements in modern standards (C++11, C++14, C++17, and C++ 20). Nonetheless, there is little empirical evidence on how developers are transitioning to use modern C++ constructs in legacy systems, and not understanding the trends and reasons for adopting these new modern C++ features might hinder software developers in conducting rejuvenation efforts. In this paper, we conduct an in-depth study to understand the development practices of KDE contributors to evolve their projects toward the use of modern C++ features. Our results show a trend in the widespread adoption of some modern C++ features (lambda expressions, auto-typed variables, and range-based for) in KDE community projects. We also found that developers in the KDE community are making large efforts to modernize their programs using automated tools, and we present some modernization scenarios and the benefits of adopting modern C++ features of the C++ programming language. Our results might help C++ software developers, in general, to evolve C++ legacy systems and tools builders to implement more effective tools that could help in rejuvenation efforts.

2024

Large Language Models in Automated Repair of Haskell Type Errors

Authors
Santos, S; Saraiva, J; Ribeiro, F;

Publication
2024 ACM/IEEE INTERNATIONAL WORKSHOP ON AUTOMATED PROGRAM REPAIR, APR 2024

Abstract
This paper introduces a new method of Automated Program Repair that relies on a combination of the GPT-4 Large Language Model and automatic type checking of Haskell programs. This method identifies the source of a type error and asks GPT-4 to fix that specific portion of the program. Then, QuickCheck is used to automatically generate a large set of test cases to validate whether the generated repair behaves as the correct solution. Our publicly available experiments revealed a success rate of 88.5% in normal conditions. However, more detailed testing should be performed to more accurately evaluate this form of APR.

2024

Trading Runtime for Energy Efficiency Leveraging Power Caps to Save Energy across Programming Languages

Authors
Cunha, S; Silva, L; Saraiva, J; Fernandes, JP;

Publication
PROCEEDINGS OF THE 17TH ACM SIGPLAN INTERNATIONAL CONFERENCE ON SOFTWARE LANGUAGE ENGINEERING, SLE 2024

Abstract
Energy efficiency of software is crucial in minimizing environmental impact and reducing operational costs of ICT systems. Energy efficiency is therefore a key area of contemporary software language engineering research. A recurrent discussion that excites our community is whether runtime performance is always a proxy for energy efficiency. While a generalized intuition seems to suggest this is the case, this intuition does not align with the fact that energy is the accumulation of power over time; hence, time is only one of the factors in this accumulation. We focus on the other factor, power, and the impact that capping it has on the energy efficiency of running software. We conduct an extensive investigation comparing regular and power-capped executions of 9 benchmark programs obtained from The Computer Language Benchmarks Game, across 20 distinct programming languages. Our results show that employing power caps can be used to trade running time, which is degraded, for energy efficiency, which is improved, in all the programming languages and in all benchmarks that were considered. We observe overall energy savings of almost 14% across the 20 programming languages, with notable savings of 27% in Haskell. This saving, however, comes at the cost of an overall increase of the program's execution time of 91% in average. We are also able to draw similar observations using language specific benchmarks for programming languages of different paradigms and with different execution models. This is achieved analyzing a wide range of benchmark programs from the nofib Benchmark Suite of Haskell Programs, DaCapo Benchmark Suite for Java, and the Python Performance Benchmark Suite. We observe energy savings of approximately 8% to 21% across the test suites, with execution time increases ranging from 21% to 46%. Notably, the DaCapo suite exhibits the most significant values, with 20.84% energy savings and a 45.58% increase in execution time. Our results have the potential to drive significant energy savings in the context of computational tasks for which runtime is not critical, including Batch Processing Systems, Background Data Processing and Automated Backups.

2024

On the Impact of PowerCap in Haskell, Java, and Python

Authors
Maia, L; Sá, M; Ferreira, I; Cunha, S; Silva, L; Azevedo, P; Saraiva, J;

Publication
Proceedings of the 3rd International Workshop on Resource AWareness of Systems and Society, Maribor, Slovenia, July 2nd - 5th, 2024.

Abstract
Historically, programming language performance focused on fast execution times. With the advent of cloud and edge computing, and the significant energy consumption of large data centers, energy efficiency has become a critical concern both for computer manufacturers and software developers. Despite the considerable efforts of the green software community in developing techniques and tools for analysing and optimising software energy consumption, there has been limited research on how imposing hardware-level energy constraints affects software energy efficiency. Moreover, prior research has demonstrated that the choice of programming language can significantly impact a program’s energy efficiency. This paper investigates the impact of CPU power capping on the energy consumption and execution time of programs written in Haskell, Java, and Python. Our preliminary results analysing well-established benchmarks indicate that while power capping does reduce energy consumption across all benchmarks, it also substantially increases execution time. These findings highlight the trade-offs between energy efficiency and runtime performance, offering insights for optimising software under energy constraints. © 2024 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).

  • 9
  • 261