EUVIMEDEUVIMED entdecken
Open Access · CC BY 4.0

A Lightweight Polyglot Code Transformation Language

Ameya Ketkar, Daniel Ramos, Lazaro Clapp, Raj Barik, Murali Krishna Ramanathan

Proceedings of the ACM on Programming Languages · 20.06.2024 · 8 (PLDI) · 1288-1312

DOI: 10.1145/3656429 ↗

Kurz gefasst

Fachartikel in der Zeitschrift Proceedings of the ACM on Programming Languages, online erschienen am 20.06.2024. Verfasst von Ameya Ketkar und 4 weiteren Autor:innen. Die Arbeit wurde bisher 3-mal zitiert (Crossref) und nennt 61 Literaturangaben. Der Volltext ist frei zugänglich (Open Access, CC BY 4.0). Gefördert von: FCT.

AbstractBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

In today’s software industry, large-scale, multi-language codebases are the norm. This brings substantial challenges in developing automated tools for code maintenance tasks such as API migration or dead code cleanup. Tool builders often find themselves caught between two less-than-ideal tooling options: (1) languagespecific code rewriting tools or (2) generic, lightweight match-replace transformation tools with limited expressiveness. The former leads to tool fragmentation and a steep learning curve for each language, while the latter forces developers to create ad-hoc, throwaway scripts to handle realistic tasks. To fill this gap, we introduce a new declarative domain-specific language (DSL) for expressing interdependent multi-language code transformations. Our key insight is that we can increase the expressiveness and applicability of lightweight match-replace tools by extending them to support for composition, ordering, and flow. We implemented an open-source tool for our language, called P olyglot P iranha , and deployed it in an industrial setting. We demonstrate its effectiveness through three case studies, where it deleted 210K lines of dead code and migrated 20K lines, across 1611 pull requests. We compare our DSL against state-of-the-art alternatives, and show that the tools we developed are faster, more concise, and easier to maintain.

Förderung

  • FCT

Zitieren

APA

Ketkar, A., Ramos, D., Clapp, L., Barik, R., & Ramanathan, M. K. (2024). A Lightweight Polyglot Code Transformation Language. Proceedings of the ACM on Programming Languages, 8(PLDI), 1288-1312. https://doi.org/10.1145/3656429

Vancouver

Ketkar A, Ramos D, Clapp L, Barik R, Ramanathan MK. A Lightweight Polyglot Code Transformation Language. Proceedings of the ACM on Programming Languages. 2024;8(PLDI):1288-1312. doi:10.1145/3656429

BibTeX
@article{Ketkar2024,
  author = {Ketkar, Ameya and Ramos, Daniel and Clapp, Lazaro and Barik, Raj and Ramanathan, Murali Krishna},
  title = {A Lightweight Polyglot Code Transformation Language},
  journal = {Proceedings of the ACM on Programming Languages},
  year = {2024},
  volume = {8},
  number = {PLDI},
  pages = {1288--1312},
  doi = {10.1145/3656429}
}
Kostenlos starten →