A tool-assisted approach to engineer domain-specific languages (DSLs) using Rust

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.
一种使用Rust来设计领域特定语言(dsl)的工具辅助方法
领域特定语言(dsl)在很多上下文中都是必需的,这意味着不同的执行环境。同一个DSL甚至可能必须存在于不同的环境中。我们在本文中提出了一种使用Rust语言来设计DSL的方法,该方法可用于多种环境。我们的方法侧重于选择一种实现语言Rust,它为DSL定义提供了多个编译目标。然而,这是一个相当费力的过程,因为Rust只是部分面向对象,而基于元模型的抽象语法的定义本质上是面向对象的。因此,我们提供了一个完整的DSL开发方法,从Ecore语言的元模型定义开始,然后使用代码生成工具在Rust中进行抽象语法转换,最后在不同的执行环境中部署语言。我们通过创建两个DSL来评估我们的方法,一个Petri网DSL和一个有限状态机(FSM) DSL。最后,我们讨论了Ecore2Rust转换工具可能的改进。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
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学术官方微信