arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2402.01079cs.SE
收藏

数据驱动的、基于证据的语法糖设计

Data-Driven Evidence-Based Syntactic Sugar Design

David OBrien, Robert Dyer, Tien N. Nguyen, Hridesh Rajan

AI总结:

针对编程语言语法糖设计依赖经验直觉的问题,本文提出将频繁子图挖掘应用于超1.6亿个Java方法的数据集,通过泛化控制流图挖掘代码模式,识别潜在新语法糖,为数据驱动的语言演进提供概念验证。

摘要:

编程语言是开发者的核心工具,其演进对支撑开发者的开发活动至关重要。语法糖的引入是编程语言演进的一种形式,它是提供更具可读性的替代代码结构的附加语法元素。但传统上,编程语言的设计与演进过程一直依赖经验性结论与直觉指导。近年来,开源仓库挖掘工具与方法的发展让开发者能够做出数据驱动的软件工程决策。基于此,本文提出一种推动数据驱动编程语言演进的方法:将频繁子图挖掘技术应用于包含166,827,154个开源Java方法的大规模数据集。研究通过泛化Java控制流图来挖掘该数据集,以捕捉广泛的编程语言使用模式与代码重复实例,随后提取频繁子图,识别可能具有影响力的新增语法糖机会。我们的多样化结果验证了该技术的优势:识别出多种可在Java中实现的、涉及不同编程结构的新语法糖,从而简化常见的代码惯用法。该方法有望为Java语言设计者提供有价值的洞见,并可作为数据驱动的编程语言设计与演进的概念验证。

英文摘要:

Programming languages are essential tools for developers, and their evolution plays a crucial role in supporting the activities of developers. One instance of programming language evolution is the introduction of syntactic sugars, which are additional syntax elements that provide alternative, more readable code constructs. However, the process of designing and evolving a programming language has traditionally been guided by anecdotal experiences and intuition. Recent advances in tools and methodologies for mining open-source repositories have enabled developers to make data-driven software engineering decisions. In light of this, this paper proposes an approach for motivating data-driven programming evolution by applying frequent subgraph mining techniques to a large dataset of 166,827,154 open-source Java methods. The dataset is mined by generalizing Java control-flow graphs to capture broad programming language usages and instances of duplication. Frequent subgraphs are then extracted to identify potentially impactful opportunities for new syntactic sugars. Our diverse results demonstrate the benefits of the proposed technique by identifying new syntactic sugars involving a variety of programming constructs that could be implemented in Java, thus simplifying frequent code idioms. This approach can potentially provide valuable insights for Java language designers, and serve as a proof-of-concept for data-driven programming language design and evolution.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑