Léo Olivier, Lou-Anne Sauvětre, E. Bousse, G. Sunyé
{"title":"A tool-assisted approach to engineer domain-specific languages (DSLs) using Rust","authors":"Léo Olivier, Lou-Anne Sauvětre, E. Bousse, G. Sunyé","doi":"10.1145/3550356.3563133","DOIUrl":null,"url":null,"abstract":"Domain-Specific Languages (DSLs) are required in a wide range of contexts, implying different execution environments. The same DSL may even have to exist in different environments. We propose in this paper an approach to engineer a DSL using the Rust language, which can be used to target several environments. Our approach focuses on selecting an implementation language, Rust, that provides multiple compilation targets for a DSL definition. However, this is a rather laborious process because Rust is only partially object-oriented, while the definition of a metamodel-based abstract syntax is essentially object-oriented. For this reason, we offer a complete DSL's development method beginning with the metamodel definition in Ecore language, then the abstract syntax conversion in Rust with a code generation tool, and finally the deployment of the language in different execution environments. We evaluated our approach by creating two DSLs with it, a Petri nets DSL and a Finite State Machine (FSM) DSL. Finally, we discuss possible improvements for our Ecore2Rust conversion tool.","PeriodicalId":182662,"journal":{"name":"Proceedings of the 25th International Conference on Model Driven Engineering Languages and Systems: Companion Proceedings","volume":"65 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2022-10-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 25th International Conference on Model Driven Engineering Languages and Systems: Companion Proceedings","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3550356.3563133","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
Domain-Specific Languages (DSLs) are required in a wide range of contexts, implying different execution environments. The same DSL may even have to exist in different environments. We propose in this paper an approach to engineer a DSL using the Rust language, which can be used to target several environments. Our approach focuses on selecting an implementation language, Rust, that provides multiple compilation targets for a DSL definition. However, this is a rather laborious process because Rust is only partially object-oriented, while the definition of a metamodel-based abstract syntax is essentially object-oriented. For this reason, we offer a complete DSL's development method beginning with the metamodel definition in Ecore language, then the abstract syntax conversion in Rust with a code generation tool, and finally the deployment of the language in different execution environments. We evaluated our approach by creating two DSLs with it, a Petri nets DSL and a Finite State Machine (FSM) DSL. Finally, we discuss possible improvements for our Ecore2Rust conversion tool.