{"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}
引用次数: 3
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.