用大模型实现文本型领域语言的语法与代码同步演化。
Leveraging LLMs to support co-evolution between definitions and instances of textual DSLs
- 用大模型直接处理文本实例,保持注释和格式等辅助信息。
- 小规模案例中迁移成功率高,但大规模实例易失效。
- 适合关注代码可读性与维护性的语言设计研究者。
软件语言随功能增加而演进,其语法变更会导致原有文本实例过时。虽然模型驱动工程中有大量元模型与模型协同演化的技术,但这些方法难以适用于具有文本语法的领域语言,直接应用会导致注释、布局等对理解与维护至关重要的信息丢失。本研究探索大语言模型(LLM)在支持文本型领域语言(textual DSLs)语法与实例协同演化中的潜力,特别关注其对辅助信息的保留能力。通过使用Claude-3.5和GPT-4o,在七个案例语言上进行实验,结果表明:在小规模、实例数量有限的场景下,所选大模型具备良好的迁移能力,代表了实践中常见的一类情况;但在处理更大规模实例时,存在显著可扩展性挑战,为未来研究提供了关键启示。
原文摘要 · Abstract (English)
Software languages evolve over time for various reasons, such as the addition of new features. When the language's grammar definition evolves, textual instances that originally conformed to the grammar become outdated. For DSLs in a model-driven engineering context, there exists a plethora of techniques to co-evolve models with the evolving metamodel. However, these techniques are not geared to support DSLs with a textual syntax -- applying them to textual language definitions and instances may lead to the loss of information from the original instances, such as comments and layout information, which are valuable for software comprehension and maintenance. This study explores the potential of Large Language Model (LLM)-based solutions in achieving grammar and instance co-evolution, with attention to their ability to preserve auxiliary information when directly processing textual instances. By applying two advanced language models, Claude-3.5 and GPT-4o, and conducting experiments across seven case languages, we evaluated the feasibility and limitations of this approach. Our results indicate a good ability of the considered LLMs for migrating textual instances in small-scale cases with limited instance size, which are representative of a subset of cases encountered in practice. In addition, we observe significant challenges with the scalability of LLM-based solutions to larger instances, leading to insights that are useful for informing future research.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。