Articles

Apple's Swift Makes Its Move Towards Android App Development!

by Soho Hollis Web Development New York

Apple’s Swift Language which was intended only for iOS and OS X apps will become available for Android development as Apple has decided to open source Swift. But Romain Goyet (developer) writes on a recent blog post that the developers can now start using Swift for building Android apps.

Goyet, who gained a huge fame by reverse engineering Apple’s Siri notes that Swift uses LLVM compiler and the current Swift compiler plugs into LLVM to generate binaries. LLVM actually generates assembly for an imaginary machine instead of generating a code for specific architecture. The intermediate representation will later be converted into actual code for the targeted architecture.

Swift Compiler and SwiftCore Library

  • Goyet, in his blog post describes the process in which the Swift compiler is asked to generate LLVM-IR (Intermediate Representation); the LLVM also generates the ARM ELF file format. Later, the Android Native Development Kit (NDK) which lets you use native code languages generates binary linking against the generated object file.

  • The biggest issue in using Swift for Android app development is the missing SwiftCore library. Currently, Apple is shipping the SwiftCore Library for iOS, OSX and WatchOS; they obviously don’t ship an Android version. But it has to be noted that, not all the Swift code requires SwiftCore Library. So as long as we make use of the Swift subset that doesn’t hit SwiftCore, it will not be a big problem.

Apple’s open-sourcing effort for Swift to include SwiftCore

  • Goyet also writes that he’s foreseeing Apple to include SwiftCore in its Swift outsourcing effort. If it is included, getting a SwiftCore library on Android will just be a matter of rebuilding it. Goyet is not the only developer to come up with the approach to use Swift for Android app development.

  • Last year a mobile development studio called ArcTouch wrote a proof-of-concept calculator app for both iOS and Android. ArcTouch used a custom compiler which parsed Swift code and output Java source code. The Swift code was written in Apple’s Xcode IDE. Eventually, the code was moved to Android Studio IDE to complete the build process and produce an Android APK.

So when Swift is available as an open source language, the development companies will be able to write the IDEs in which the developers write in Swift and compile to Android. As a programming language Swift is very much similar to Java and C#. So it is not that hard to get Swift to compile towards Android. Though, it’s not very clear that Swift is better than Java, it certainly has some newer constructs.


About Soho Hollis Junior   Web Development New York

0 connections, 0 recommendations, 9 honor points.
Joined APSense since, February 10th, 2014, From New York, United States.

Created on Dec 31st 1969 19:00. Viewed 0 times.

Comments

No comment, be the first to comment.
Please sign in before you comment.