sequalsk -双向Swift-Kotlin-Transpiler

Dominik Schultes
{"title":"sequalsk -双向Swift-Kotlin-Transpiler","authors":"Dominik Schultes","doi":"10.1109/MobileSoft52590.2021.00017","DOIUrl":null,"url":null,"abstract":"Developing two separate versions of an app for iOS and Android causes considerable efforts. Therefore, a lot of cross-platform development frameworks are available that are able to produce apps for both platforms out of a single code base. However, there are tradeoffs that are connected with these frameworks, in particular, a high tool dependency. Therefore, we propose to stick with native development but to take advantage of the shrinking gap between both platforms due to the fact that the current programming languages, Swift for iOS and Kotlin for Android, are considerably more alike than their respective predecessors. Relating to the model-view- controller design pattern, we propose to automatically transpile the model part (which includes the business logic) of the app in a bidirectional fashion, i.e., from Kotlin to Swift and vice versa. This way, iOS experts can concentrate on optimizing the user interface (view- and controller-part) for iOS, and Android experts can do the same for Android, but all developers can jointly work on the shared model part: each developer can read, correct, and enhance the source code of the model using their own preferred programming language; the resulting version is then transpiled to an equivalent version in the other language.We present a working prototype of a transpiler—which we call SequalsK—that supports the majority of the important constructs of both languages and is able to generate syntactically and semantically correct Kotlin code out of Swift code and vice versa.In a case study we show that the model part of a board game app can be transpiled in both directions without any limitations. Starting with a working Swift version, the Android version can be derived with little manual effort: the automatically transpiled model part forms 86 percent of the resulting source code.","PeriodicalId":257528,"journal":{"name":"2021 IEEE/ACM 8th International Conference on Mobile Software Engineering and Systems (MobileSoft)","volume":"50 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2021-05-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"3","resultStr":"{\"title\":\"SequalsK—A Bidirectional Swift-Kotlin-Transpiler\",\"authors\":\"Dominik Schultes\",\"doi\":\"10.1109/MobileSoft52590.2021.00017\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Developing two separate versions of an app for iOS and Android causes considerable efforts. Therefore, a lot of cross-platform development frameworks are available that are able to produce apps for both platforms out of a single code base. However, there are tradeoffs that are connected with these frameworks, in particular, a high tool dependency. Therefore, we propose to stick with native development but to take advantage of the shrinking gap between both platforms due to the fact that the current programming languages, Swift for iOS and Kotlin for Android, are considerably more alike than their respective predecessors. Relating to the model-view- controller design pattern, we propose to automatically transpile the model part (which includes the business logic) of the app in a bidirectional fashion, i.e., from Kotlin to Swift and vice versa. This way, iOS experts can concentrate on optimizing the user interface (view- and controller-part) for iOS, and Android experts can do the same for Android, but all developers can jointly work on the shared model part: each developer can read, correct, and enhance the source code of the model using their own preferred programming language; the resulting version is then transpiled to an equivalent version in the other language.We present a working prototype of a transpiler—which we call SequalsK—that supports the majority of the important constructs of both languages and is able to generate syntactically and semantically correct Kotlin code out of Swift code and vice versa.In a case study we show that the model part of a board game app can be transpiled in both directions without any limitations. Starting with a working Swift version, the Android version can be derived with little manual effort: the automatically transpiled model part forms 86 percent of the resulting source code.\",\"PeriodicalId\":257528,\"journal\":{\"name\":\"2021 IEEE/ACM 8th International Conference on Mobile Software Engineering and Systems (MobileSoft)\",\"volume\":\"50 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2021-05-01\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"3\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"2021 IEEE/ACM 8th International Conference on Mobile Software Engineering and Systems (MobileSoft)\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1109/MobileSoft52590.2021.00017\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"2021 IEEE/ACM 8th International Conference on Mobile Software Engineering and Systems (MobileSoft)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/MobileSoft52590.2021.00017","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 3

摘要

为iOS和Android开发两个不同版本的应用需要付出相当大的努力。因此,有很多跨平台开发框架可以用一个代码库为两个平台开发应用程序。然而,与这些框架相关的权衡,特别是对工具的高度依赖。因此,我们建议坚持原生开发,但要利用两个平台之间不断缩小的差距,因为当前的编程语言,iOS的Swift和Android的Kotlin,比它们各自的前辈更加相似。关于模型-视图-控制器设计模式,我们建议以双向方式自动转换应用程序的模型部分(包括业务逻辑),即从Kotlin到Swift,反之亦然。这样,iOS专家可以专注于优化iOS的用户界面(视图和控制器部分),Android专家也可以为Android做同样的事情,但所有开发人员可以共同致力于共享模型部分:每个开发人员可以使用自己喜欢的编程语言阅读、修改和增强模型的源代码;然后将结果版本翻译成另一种语言的等效版本。我们展示了一个翻译器的工作原型——我们称之为sequalsk——它支持两种语言的大多数重要结构,并且能够从Swift代码中生成语法和语义正确的Kotlin代码,反之亦然。在一个案例研究中,我们展示了桌面游戏应用的模型部分可以在没有任何限制的情况下向两个方向转换。从一个工作的Swift版本开始,Android版本可以通过很少的手工工作派生出来:自动转译的模型部分占最终源代码的86%。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
SequalsK—A Bidirectional Swift-Kotlin-Transpiler
Developing two separate versions of an app for iOS and Android causes considerable efforts. Therefore, a lot of cross-platform development frameworks are available that are able to produce apps for both platforms out of a single code base. However, there are tradeoffs that are connected with these frameworks, in particular, a high tool dependency. Therefore, we propose to stick with native development but to take advantage of the shrinking gap between both platforms due to the fact that the current programming languages, Swift for iOS and Kotlin for Android, are considerably more alike than their respective predecessors. Relating to the model-view- controller design pattern, we propose to automatically transpile the model part (which includes the business logic) of the app in a bidirectional fashion, i.e., from Kotlin to Swift and vice versa. This way, iOS experts can concentrate on optimizing the user interface (view- and controller-part) for iOS, and Android experts can do the same for Android, but all developers can jointly work on the shared model part: each developer can read, correct, and enhance the source code of the model using their own preferred programming language; the resulting version is then transpiled to an equivalent version in the other language.We present a working prototype of a transpiler—which we call SequalsK—that supports the majority of the important constructs of both languages and is able to generate syntactically and semantically correct Kotlin code out of Swift code and vice versa.In a case study we show that the model part of a board game app can be transpiled in both directions without any limitations. Starting with a working Swift version, the Android version can be derived with little manual effort: the automatically transpiled model part forms 86 percent of the resulting source code.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
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学术官方微信