ABSTRACT
Mobile application developers often target both iOS and Android in an effort to extend their target user base. There are several tools that can aid this development effort, allowing developers to maintain a single codebase for both platforms instead of two. These tools often face a few shortcomings, of which two are noteworthy: they are hard-to-replace dependencies in the codebase, and often present some type of obstacle for integrating platform-independent native code with the shared codebase. The goal of this work is to propose a new approach to creating cross-platform development tools that improves on these two aspects, and to analyze the viability of a real-world implementation of the proposed approach. An analysis of the current state of the practice indicates cross-platform compilers as a promising direction, and a study is made on the common concerns and challenges faced when developing these compilers. Based on these analyses, this work proposes the creation of a compiler that translates one platform's hand-written native code into maintainable native code for the other platform. The feasibility of implementating this approach is tested with the development of a proof-of-concept compiler from Swift to Kotlin. An analysis is made on the readability of the resulting prototype's output code, as well as other relevant metrics. The conclusion is that, while some trade-offs might be necessary, such an approach is viable if applied in an adequate ecosystem.
- Adobe. [n.d.]. Adobe PhoneGap. Retrieved on 2020-06-15, from https://phonegap. com.Google Scholar
- P.F. ALBRECHT, P.E. GARRISON, S.L. GRAHAM, R.H. HYERLE, P. IP, and B. KRIEG-BRÜCKNER. 1980. Source-to-source Translation: Ada to Pascal and Pascal to Ada. In Proceedings of the ACM-SIGPLAN Symposium on Ada Programming Language (SIGPLAN '80). ACM, New York, NY, USA, 183--193. https://doi.org/10.1145/948632.948658Google ScholarDigital Library
- P. ARRIGHI, J. GIRARD, M. LEZAMA, and K. MAZET. 2014. The GOOL System: A Lightweight Object-oriented Programming Language Translator. In Proceedings of the 9th International Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems PLE (ICOOOLPS '14). ACM, New York, NY, USA, Article 5, 7 pages. https://doi.org/10.1145/2633301.2633306Google ScholarDigital Library
- T. BALL. 2013. cfront: a J2ObjC Inspiration. Retrieved on 2020-06-15, from http://j2objc.blogspot.com/2013/09/cfront-j2objc-inspiration-developers.html.Google Scholar
- N. BARTH. 2014. Análise Comparativa de Ferramentas de Desenvolvimento de Aplicativos Móveis Multiplataforma. Bachelor's thesis. Universidade Regional de Blumenau.Google Scholar
- A. CHARLAND and B. LEROUX. 2011. Mobile Application Development: Web vs. Native. Queue 9, 4, Article 20 (April 2011), 9 pages. https://doi.org/10.1145/1966989.1968203Google ScholarDigital Library
- L. CORRAL, A. SILLITTI, and G. SUCCI. 2012. Mobile Multiplatform Development: An Experiment for Performance Analysis. Procedia Computer Science 10 (2012), 736--743. https://doi.org/10.1016/j.procs.2012.06.094Google ScholarCross Ref
- W.S. EL-KASSAS, B.A. ABDULLAH, A.H. YOUSEF, and A. WAHBA. 2014. ICPMD: Integrated cross-platform mobile development solution. In 2014 9th International Conference on Computer Engineering Systems (ICCES). 307--317. https://doi.org/10.1109/ICCES.2014.7030977Google ScholarCross Ref
- Facebook. 2012. Under the hood: Rebuilding Facebook for iOS. Retrieved on 2020-06-15, from https://www.facebook.com/notes/facebook-engineering/under-the-hood-rebuilding-facebook-for-ios/10151036091753920.Google Scholar
- Facebook. 2020. React Native. Retrieved on 2020-06-15, from https://facebook.github.io/react-native/.Google Scholar
- O. LE GOAER and S. WALTHAM. 2013. Yet Another DSL for Cross-platforms Mobile Development. In Proceedings of the First Workshop on the Globalization of Domain Specific Languages (GlobalDSL '13). ACM, New York, NY, USA, 28--33. https://doi.org/10.1145/2489812.2489819Google ScholarDigital Library
- Google. [n.d.]. J2ObjC: Overview. Retrieved on 2020-06-15, from https://developers.google.com/j2objc.Google Scholar
- Google. 2020. Flutter. Retrieved on 2020-06-15, from https://flutter.dev.Google Scholar
- I. GOUY. [n.d.]. The Computer Language Benchmarks Game. Retrieved on 2020-06-15, from https://benchmarksgame-team.pages.debian.net/benchmarksgame/sometimes-people-just-make-up-stuff.html.Google Scholar
- E. GUTHMANN. 2019. The (not so) hidden cost of sharing code between iOS and Android. Retrieved on 2020-06-15, from https://blogs.dropbox.com/tech/2019/08/the-not-so-hidden-cost-of-sharing-code-between-ios-and-android/.Google Scholar
- H. HEITKÖTTER, T.A. MAJCHRZAK, and H. KUCHEN. 2013. Cross-platform Model-driven Development of Mobile Applications with Md2. In Proceedings of the 28th Annual ACM Symposium on Applied Computing (SAC '13). ACM, New York, NY, USA, 526--533. https://doi.org/10.1145/2480362.2480464Google ScholarDigital Library
- H.HEITKÖTTER, S. HANSCHKE, and T.A. MAJCHRZAK. 2013. Evaluating Cross-Platform Development Approaches for Mobile Applications. In Web Information Systems and Technologies. Springer Berlin Heidelberg, Berlin, Heidelberg, 120--138.Google Scholar
- A. HOLZINGER, P. TREITLER, and W. SLANY. 2012. Making Apps Useable on Multiple Different Mobile Platforms: On Interoperability for Business Application Development on Smartphones. In Multidisciplinary Research and Practice for Information Systems. Springer Berlin Heidelberg, Berlin, Heidelberg, 176--189.Google Scholar
- R.D. HUIJSMAN, K.J. VAN KATWIJK, C. PRONK, and W.J. TOETENEL. 1987. Translating Algol 60 Programs into Ada. Ada Lett. VII, 5 (September 1987), 42--50. https://doi.org/10.1145/36077.36080Google ScholarDigital Library
- S.JIANG. 2016. Comparison of Native, Cross-Platform and Hyper Mobile Development Tools Approaches for iOS and Android Mobile Applications. Bachelor's thesis. Department of Computer Science and Engineering, University of Gothenburg.Google Scholar
- Kotlin. [n.d.]. Kotlin/Native. Retrieved on 2020-06-15, from https://kotlinlang. org/docs/reference/native-overview.html.Google Scholar
- D. MACOS and A. SOLYMOSI. 2013. ScaMo: Realisation of an OO-functional DSL for cross platform mobile applications development. AIP Conference Proceedings 1558, 1 (2013), 327--331. https://doi.org/10.1063/1.4825490 arXiv:https://aip.scitation.org/doi/pdf/10.1063/1.4825490Google ScholarCross Ref
- R. MADAUDO and P. SCANDURRA. 2013. Native versus Cross-platform frameworks for mobile application development. In VIII Workshop of the Italian Eclipse Community.Google Scholar
- Moshbit. 2020. Kotlift. Retrieved on 2020-06-15, from https://github.com/moshbit/Kotlift.Google Scholar
- A.G. OLLOQUI. 2020. SwiftKotlin. Retrieved on 2020-06-15, from https://github. com/angelolloqui/SwiftKotlin.Google Scholar
- Oracle. 2019. Java SE 12 & JDK 12 Documentation: CopyOnWriteArrayList. Available on https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/util/concurrent/CopyOnWriteArrayList.html, retrieved on 2020-06-15.Google Scholar
- M. PALMIERI, I. SINGH, and A. CICCHETTI. 2012. Comparison of cross-platform mobile development tools. In 2012 16th International Conference on Intelligence in Next Generation Networks. 179--186. https://doi.org/10.1109/ICIN.2012.6376023Google ScholarCross Ref
- G. PEAL. 2018. React Native at Airbnb. Retrieved on 2020-06-15, from https://medium.com/airbnb-engineering/react-native-at-airbnb-f95aa460be1c.Google Scholar
- J. PERCHAT, M. DESERTOT, and S. LECOMTE. 2013. Component based Framework to Create Mobile Cross-platform Applications. Procedia Computer Science 19 (2013), 1004--1011. https://doi.org/10.1016/j.procs.2013.06.140 The 4th International Conference on Ambient Systems, Networks and Technologies (ANT 2013), the 3rd International Conference on Sustainable Energy Information Technology (SEIT-2013).Google ScholarCross Ref
- J. PERCHAT, M. DESERTOT, and S. LECOMTE. 2014. Common framework: A hybrid approach to integrate cross-platform components in mobile application. Journal of Computer Science 10 (November 2014), 2165--2181.Google ScholarCross Ref
- Pinterest. 2020. ktlint: An anti-bikeshedding Kotlin linter with built-in formatter. Retrieved on 2020-06-15, from https://github.com/pinterest/ktlint.Google Scholar
- D.A. PLAISTED. 2013. Source-to-source translation and software engineering. Journal of Software Engineering and Applications 6, 04 (2013), 30.Google ScholarCross Ref
- A. PUDER and O. ANTEBI. 2013. Cross-Compiling Android Applications to iOS and Windows Phone 7. Mobile Networks and Applications 18, 1 (February 2013), 3--21. https://doi.org/10.1007/s11036-012-0374-2Google ScholarDigital Library
- Readdle. 2018. Swift for Android: Our Experience and Tools. Retrieved on 2020-06-15, from https://blog.readdle.com/why-we-use-swift-for-android-db449feeacaf.Google Scholar
- S. SCHAUB and B.A. MALLOY. 2016. The Design and Evaluation of an Interoperable Translation System for Object-Oriented Software Reuse. Journal of Object Technology 15, 4 (2016).Google ScholarCross Ref
- V. VENDRAMINI. 2019. Research data on the Gryphon transpiler. https://doi.org/10.5281/zenodo.3489737 Retrieved on 2020-08-11, from https://github.com/vinivendra/GryphonResearch.Google ScholarCross Ref
- V. VENDRAMINI. 2020. Gryphon: The Swift to Kotlin translator. https://doi.org/10.5281/zenodo.3489740 Retrieved on 2020-08-11, from https://github.com/vinivendra/Gryphon.Google ScholarCross Ref
- P.J.L. WALLIS. 1985. Automatic Language Conversion and Its Place in the Transition to Ada. In Proceedings of the 1985 Annual ACM SIGAda International Conference on Ada (SIGAda '85). Cambridge University Press, New York, NY, USA, 275--284. https://doi.org/10.1145/324426.324399Google ScholarDigital Library
- Q. YI. 2012. POET: A scripting language for applying parameterized source-to-source program transformations. Software: Practice and Experience 42 (June 2012). https://doi.org/10.1002/spe.1089Google ScholarDigital Library
Index Terms
- Improving mobile app development using transpilers with maintainable outputs
Recommendations
Evaluating swift-to-kotlin and kotlin-to-swift transpilers
MOBILESoft '22: Proceedings of the 9th IEEE/ACM International Conference on Mobile Software Engineering and SystemsUnlike most popular mobile cross-platform development frameworks, transpilers promise maintainable code bases that are independent of the continued life of the development tools used. As more and more transpiler projects using the native programming ...
A Swift Introduction to Swift App Development (Abstract Only)
SIGCSE '15: Proceedings of the 46th ACM Technical Symposium on Computer Science EducationSwift is a new programming language recently introduced by Apple as a replacement for Objective-C. Considering that Objective-C ranks third on the Tiobe Index and is the progenitor of virtually all the 1.2 million apps in the App Store, Swift is likely ...
Comments