Open-Source 'Swift' Could Be The New Language For Android


In order to make the iPhone that much leaner and easier to program for, Apple wound up creating the Swift programming language to replace the deep-level language, Objective C, that had been used since the inception of iOS. Objective C, used at the core of tons of Linux-based systems. A variant of Objective C, C++, actually lies at the core of Android, underneath Java. Near the end of last year, Apple made Swift open-source. This move attracted the attention of Facebook, Uber and Google. Google, in particular, took a keen interest in the newly open-source language. Details suggest that Google was reportedly giving serious consideration to replacing Android's current backend with Swift.

While Swift was made to replace a C-based language, it is certainly not usable as an in-place swap out, especially with a system like Android whose core functions depend on a layer over a C variant, being Java in this case. In order to pull this off, all of the core Android code that runs on the C++ backend would have to be ported to Swift, as well as all of the Java functions, bringing the setup from a shell and core ordeal to a more cohesive and holistic code base. This would be a massive undertaking, but amateur developers have already proven, in theory at least, that it's possible; One developer, Romain Goyet, managed to do some monkeying around with Swift and Android, though it was far from a comprehensive system replacement.


In essence, Google would have to rip out Android's guts and rewrite them for Swift, as it's not cross-compatible with Java or C++. An easy way out would be, of course, to program a bridge, but that could introduce bugs and performance problems. To add insult to injury, making a simple bridge would still leave Google using Java in some form and thus on the hook to Oracle, who is already after them in court for damages and, in essence, royalties, for their extensive use of Java in Android. As an aside, a second language, Kotlin, is in consideration – it is also object-based and open-source, as well as compatible enough with Java to serve as an in-place replacement. At the moment, however, Google is saying that it's too slow to use for such purposes.

Share this page

Copyright ©2016 Android Headlines. All Rights Reserved.

This post may contain affiliate links. See our privacy policy for more information.
Senior Staff Writer

Daniel has been writing for Android Headlines since 2015, and is one of the site's Senior Staff Writers. He's been living the Android life since 2010, and has been interested in technology of all sorts since childhood. His personal, educational and professional backgrounds in computer science, gaming, literature, and music leave him uniquely equipped to handle a wide range of news topics for the site. These include the likes of machine learning, Voice assistants, AI technology development news in the Android world. Contact him at [email protected]

View Comments