{"title":"Code Less to Code More","authors":"Federico Bruzzone, Walter Cazzola, 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><</mo><mo><</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}
引用次数: 0
Abstract
Developing editing support for languages in 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 to , 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 to 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 , where represents the number of type systems. Further reuse of language artifacts across languages lowers this to , where , 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.
期刊介绍:
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.