少写代码,多写代码

IF 4.1 2区 计算机科学 Q1 COMPUTER SCIENCE, SOFTWARE ENGINEERING
Federico Bruzzone, Walter Cazzola, Luca Favalli
{"title":"少写代码,多写代码","authors":"Federico Bruzzone,&nbsp;Walter Cazzola,&nbsp;Luca Favalli","doi":"10.1016/j.jss.2025.112554","DOIUrl":null,"url":null,"abstract":"<div><div>Developing editing support for <span><math><mi>L</mi></math></span> languages in <span><math><mi>E</mi></math></span> editors is complex and time-consuming. Some languages do not provide dedicated editors, while others offer a single native editor. The <em>language server protocol</em> (LSP) reduces the language-editor combinations <span><math><mrow><mi>L</mi><mo>×</mo><mi>E</mi></mrow></math></span> to <span><math><mrow><mi>L</mi><mo>+</mo><mi>E</mi></mrow></math></span>, where a single language server communicates with editors via LSP plugins. However, overlapping implementations of linguistic components remain an issue. Existing language workbenches struggle with modularity, reusability, and leveraging type systems for language server generation. In this work, we propose: (i) Typelang, a family of domain-specific languages for modular, composable, and reusable type system implementation, (ii) a modular language server generation process, producing servers for languages built in a modular workbench, (iii) the variant-oriented programming paradigm and a cross-artifact coordination layer to manage interdependent software variants, and (iv) an LSP plugin generator, reducing <span><math><mi>E</mi></math></span> to <span><math><mi>1</mi></math></span> by automating plugin creation for multiple editors. To simplify editing support for language families, each language artifact integrates its own Typelang variant, used to generate language servers. This reduces combinations to <span><math><mrow><mi>T</mi><mo>×</mo><mi>1</mi></mrow></math></span>, where <span><math><mrow><mi>T</mi><mo>=</mo><mi>L</mi></mrow></math></span> represents the number of type systems. Further reuse of language artifacts across languages lowers this to <span><math><mrow><mi>N</mi><mo>×</mo><mi>1</mi></mrow></math></span>, where <span><math><mrow><mi>N</mi><mo>&lt;</mo><mo>&lt;</mo><mi>T</mi></mrow></math></span>, representing unique type systems. We implement Typelang in Neverlang, generating language servers for each artifact and LSP plugins for three editors. Empirical evaluation shows a 93.48% reduction in characters needed for type system implementation and 100% automation of LSP plugin generation, significantly lowering effort for editing support in language families, especially when artifacts are reused.</div></div>","PeriodicalId":51099,"journal":{"name":"Journal of Systems and Software","volume":"231 ","pages":"Article 112554"},"PeriodicalIF":4.1000,"publicationDate":"2025-09-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Code Less to Code More\",\"authors\":\"Federico Bruzzone,&nbsp;Walter Cazzola,&nbsp;Luca Favalli\",\"doi\":\"10.1016/j.jss.2025.112554\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<div><div>Developing editing support for <span><math><mi>L</mi></math></span> languages in <span><math><mi>E</mi></math></span> editors is complex and time-consuming. Some languages do not provide dedicated editors, while others offer a single native editor. The <em>language server protocol</em> (LSP) reduces the language-editor combinations <span><math><mrow><mi>L</mi><mo>×</mo><mi>E</mi></mrow></math></span> to <span><math><mrow><mi>L</mi><mo>+</mo><mi>E</mi></mrow></math></span>, where a single language server communicates with editors via LSP plugins. However, overlapping implementations of linguistic components remain an issue. Existing language workbenches struggle with modularity, reusability, and leveraging type systems for language server generation. In this work, we propose: (i) Typelang, a family of domain-specific languages for modular, composable, and reusable type system implementation, (ii) a modular language server generation process, producing servers for languages built in a modular workbench, (iii) the variant-oriented programming paradigm and a cross-artifact coordination layer to manage interdependent software variants, and (iv) an LSP plugin generator, reducing <span><math><mi>E</mi></math></span> to <span><math><mi>1</mi></math></span> by automating plugin creation for multiple editors. To simplify editing support for language families, each language artifact integrates its own Typelang variant, used to generate language servers. This reduces combinations to <span><math><mrow><mi>T</mi><mo>×</mo><mi>1</mi></mrow></math></span>, where <span><math><mrow><mi>T</mi><mo>=</mo><mi>L</mi></mrow></math></span> represents the number of type systems. Further reuse of language artifacts across languages lowers this to <span><math><mrow><mi>N</mi><mo>×</mo><mi>1</mi></mrow></math></span>, where <span><math><mrow><mi>N</mi><mo>&lt;</mo><mo>&lt;</mo><mi>T</mi></mrow></math></span>, representing unique type systems. We implement Typelang in Neverlang, generating language servers for each artifact and LSP plugins for three editors. Empirical evaluation shows a 93.48% reduction in characters needed for type system implementation and 100% automation of LSP plugin generation, significantly lowering effort for editing support in language families, especially when artifacts are reused.</div></div>\",\"PeriodicalId\":51099,\"journal\":{\"name\":\"Journal of Systems and Software\",\"volume\":\"231 \",\"pages\":\"Article 112554\"},\"PeriodicalIF\":4.1000,\"publicationDate\":\"2025-09-16\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Journal of Systems and Software\",\"FirstCategoryId\":\"94\",\"ListUrlMain\":\"https://www.sciencedirect.com/science/article/pii/S0164121225002237\",\"RegionNum\":2,\"RegionCategory\":\"计算机科学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q1\",\"JCRName\":\"COMPUTER SCIENCE, SOFTWARE ENGINEERING\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Systems and Software","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0164121225002237","RegionNum":2,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"COMPUTER SCIENCE, SOFTWARE ENGINEERING","Score":null,"Total":0}
引用次数: 0

摘要

在E编辑器中开发对L语言的编辑支持既复杂又耗时。有些语言不提供专门的编辑器,而其他语言则提供单一的本机编辑器。语言服务器协议(LSP)将语言编辑器组合L×E减少为L+E,其中单个语言服务器通过LSP插件与编辑器通信。然而,语言组件的重叠实现仍然是一个问题。现有的语言工作台在模块化、可重用性和利用类型系统生成语言服务器方面遇到了困难。在这项工作中,我们提出:(i) Typelang,用于模块化、可组合和可重用类型系统实现的一系列领域特定语言;(ii)模块化语言服务器生成过程,为模块化工作台中构建的语言生成服务器;(iii)面向变量的编程范式和跨工件协调层,以管理相互依赖的软件变体;(iv) LSP插件生成器,通过为多个编辑器自动创建插件,将E减少到1。为了简化对语言族的编辑支持,每种语言工件都集成了自己的Typelang变体,用于生成语言服务器。这将组合减少到T×1,其中T=L表示类型系统的数量。跨语言的语言工件的进一步重用将其降低到N×1,其中N<;<;T表示唯一的类型系统。我们在Neverlang中实现Typelang,为每个工件生成语言服务器,为三个编辑器生成LSP插件。经验评估表明,类型系统实现所需的字符减少了93.48%,LSP插件生成的自动化程度达到100%,显著降低了语言族中编辑支持的工作量,特别是当工件被重用时。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
Code Less to Code More
Developing editing support for L languages in E editors is complex and time-consuming. Some languages do not provide dedicated editors, while others offer a single native editor. The language server protocol (LSP) reduces the language-editor combinations L×E to L+E, where a single language server communicates with editors via LSP plugins. However, overlapping implementations of linguistic components remain an issue. Existing language workbenches struggle with modularity, reusability, and leveraging type systems for language server generation. In this work, we propose: (i) Typelang, a family of domain-specific languages for modular, composable, and reusable type system implementation, (ii) a modular language server generation process, producing servers for languages built in a modular workbench, (iii) the variant-oriented programming paradigm and a cross-artifact coordination layer to manage interdependent software variants, and (iv) an LSP plugin generator, reducing E to 1 by automating plugin creation for multiple editors. To simplify editing support for language families, each language artifact integrates its own Typelang variant, used to generate language servers. This reduces combinations to T×1, where T=L represents the number of type systems. Further reuse of language artifacts across languages lowers this to N×1, where N<<T, representing unique type systems. We implement Typelang in Neverlang, generating language servers for each artifact and LSP plugins for three editors. Empirical evaluation shows a 93.48% reduction in characters needed for type system implementation and 100% automation of LSP plugin generation, significantly lowering effort for editing support in language families, especially when artifacts are reused.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
Journal of Systems and Software
Journal of Systems and Software 工程技术-计算机:理论方法
CiteScore
8.60
自引率
5.70%
发文量
193
审稿时长
16 weeks
期刊介绍: The Journal of Systems and Software publishes papers covering all aspects of software engineering and related hardware-software-systems issues. All articles should include a validation of the idea presented, e.g. through case studies, experiments, or systematic comparisons with other approaches already in practice. Topics of interest include, but are not limited to: •Methods and tools for, and empirical studies on, software requirements, design, architecture, verification and validation, maintenance and evolution •Agile, model-driven, service-oriented, open source and global software development •Approaches for mobile, multiprocessing, real-time, distributed, cloud-based, dependable and virtualized systems •Human factors and management concerns of software development •Data management and big data issues of software systems •Metrics and evaluation, data mining of software development resources •Business and economic aspects of software development processes The journal welcomes state-of-the-art surveys and reports of practical experience for all of these topics.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信