DSL-Xpert 2.0: Enhancing LLM-driven code generation for domain-specific languages

Bibliographic citation

Lamas, V., Garcia-Gonzalez, D., Sala, L., & Luaces, M. R. (2025). DSL-Xpert 2.0: Enhancing LLM-Driven code generation for domain-specific languages. Information and Software Technology, 107954. https://doi.org/10.1016/j.infsof.2025.107954

Type of academic work

Academic degree

Abstract

[Abstract]: Context: Domain-specific languages (DSLs) are crucial for modeling specialized concepts and offer more fluency and efficiency compared to general-purpose languages. However, their adoption is often slowed by steep learning curves, limited tools, and complex implementations. While large language models (LLMs) have the ability to generate DSL code from natural language, their effectiveness in niche areas is limited due to insufficient training on specific DSL definitions. Objectives: This paper introduces DSL-Xpert 2.0, a tool designed to overcome these challenges by utilizing LLMs to generate DSL code with ease. Methods: By integrating grammar prompting and few-shot learning, the tool effectively handles proprietary DSLs. Additionally, advanced features such as automatic grammar validation, input/output correction, and integration with platforms like OpenAI, HuggingFace, and WebLLM ensure robust and reliable results. These features also simplify workflows for both novice and expert users. The paper further demonstrates the tool's practical value with a running example that illustrates its workflow and includes a complementary user survey conducted across various DSLs of differing complexity. This survey, based on the Technology Acceptance Model (TAM), helps assess the tool’s impact on reducing the DSL learning curve. Results: DSL-Xpert 2.0’s user-friendly and flexible design supports a broad range of DSLs with minimal configuration. Its intuitive interface allows developers to focus on problem-solving, rather than technical issues. User survey results indicate that DSL-Xpert 2.0 significantly reduces the learning effort needed to work with DSLs, and it is perceived as both useful and easy to use. The paper also includes a detailed performance analysis across various LLMs, demonstrating the tool's adaptability and effectiveness. Conclusion: By simplifying DSL development and lowering the barriers to entry, DSL-Xpert 2.0 accelerates the adoption and innovation of DSLs, making it a valuable resource for domain-specific projects.

Description

The tool is available to download at https://github.com/lbdudc/dsl-xpert, along with the user manual. Regarding the text-to-DSL experiments, the framework used is available at https://github.com/lucasala1997/text-to-DSL.

Rights

Attribution-NonCommercial-NoDerivatives 4.0 International
Attribution-NonCommercial-NoDerivatives 4.0 International

Except where otherwise noted, this item's license is described as Attribution-NonCommercial-NoDerivatives 4.0 International