The development of programming languages involves complex theoretical and practical challenges, particularly when addressing modularity and reusability through language extensions. While language workbenches aim to enable modular development under the constraints of the language extension problem, one critical constraint -- separate compilation -- is often relaxed due to its complexity. However, this relaxation undermines artifact reusability and integration with common dependency systems. A key difficulty under separate compilation arises from managing attribute grammars, as extensions may introduce new attributes that invalidate previously generated abstract syntax tree structures. Existing approaches, such as the use of dynamic maps in the Neverlang workbench, favor flexibility at the cost of compile-time correctness, leading to potential runtime errors due to undefined attributes. This work addresses this issue by introducing nlgcheck, a theoretically sound static analysis tool based on data-flow analysis for the Neverlang language workbench. nlgcheck detects potential runtime errors -- such as undefined attribute accesses -- at compile time, preserving separate compilation while maintaining strong static correctness guarantees. Experimental evaluation using mutation testing on Neverlang-based projects demonstrates that nlgcheck effectively enhances robustness without sacrificing modularity or flexibility and with a level of performance that does not impede its adoption in daily development activities.


翻译:编程语言的发展涉及复杂的理论与实际挑战,尤其在通过语言扩展解决模块化与可复用性问题时。虽然语言工作台旨在语言扩展问题的约束下实现模块化开发,但一个关键约束——独立编译——因其复杂性常被放宽。然而,这种放宽会损害制品的可复用性以及与常见依赖系统的集成。独立编译下的一个主要困难源于属性文法的管理,因为扩展可能引入新的属性,从而使先前生成的抽象语法树结构失效。现有方法(例如Neverlang工作台中使用的动态映射)以牺牲编译时正确性为代价换取灵活性,导致因未定义属性而可能产生运行时错误。本研究通过引入nlgcheck来解决这一问题,这是一个基于数据流分析、理论可靠的静态分析工具,专为Neverlang语言工作台设计。nlgcheck能在编译时检测潜在的运行时错误(例如未定义属性访问),在保持独立编译的同时提供强大的静态正确性保证。通过对基于Neverlang的项目进行变异测试的实验评估表明,nlgcheck能有效增强鲁棒性,且不牺牲模块化或灵活性,其性能水平亦不会阻碍在日常开发活动中的采用。

0
下载
关闭预览

相关内容

一个具体事物,总是有许许多多的性质与关系,我们把一个事物的性质与关系,都叫作事物的属性。 事物与属性是不可分的,事物都是有属性的事物,属性也都是事物的属性。 一个事物与另一个事物的相同或相异,也就是一个事物的属性与另一事物的属性的相同或相异。 由于事物属性的相同或相异,客观世界中就形成了许多不同的事物类。具有相同属性的事物就形成一类,具有不同属性的事物就分别地形成不同的类。
迈向透明人工智能(AI):可解释性语言模型综述
专知会员服务
15+阅读 · 2025年9月29日
大型语言模型:原理、实现与发展
专知会员服务
102+阅读 · 2023年11月28日
【牛津大学博士论文】可微分编程的结构基础,176页pdf
专知会员服务
26+阅读 · 2023年8月20日
近期声学领域前沿论文(No. 3)
深度学习每日摘要
24+阅读 · 2019年3月31日
近期语音类前沿论文
深度学习每日摘要
14+阅读 · 2019年3月17日
自然语言处理精品资料
人工智能前沿讲习班
14+阅读 · 2019年3月13日
语料库构建——自然语言理解的基础
计算机研究与发展
11+阅读 · 2017年8月21日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关VIP内容
迈向透明人工智能(AI):可解释性语言模型综述
专知会员服务
15+阅读 · 2025年9月29日
大型语言模型:原理、实现与发展
专知会员服务
102+阅读 · 2023年11月28日
【牛津大学博士论文】可微分编程的结构基础,176页pdf
专知会员服务
26+阅读 · 2023年8月20日
相关资讯
近期声学领域前沿论文(No. 3)
深度学习每日摘要
24+阅读 · 2019年3月31日
近期语音类前沿论文
深度学习每日摘要
14+阅读 · 2019年3月17日
自然语言处理精品资料
人工智能前沿讲习班
14+阅读 · 2019年3月13日
语料库构建——自然语言理解的基础
计算机研究与发展
11+阅读 · 2017年8月21日
相关基金
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员