Ⓚ Kotlin/Native for iOS development
updated 12 months ago; latest suggestion 12 months ago
This proposal has been withdrawn...
JetBrains, the company which developed IntelliJ IDEa, AppCode and other cool IDEs, also known as a founder of Kotlin programming language.
Kotlin has become a first class citizen programming language for Android development last year.
This is functional programming language, which is extremely similar to Swift in the concept and syntax.
This means, that Swift developers may read/write Kotlin code fairly easy, likewise in the opposite direction: Kotlin devs -> Swift code.
JetBrains introduced recently another framework called Kotlin/Native.
Kotlin/Native is an LLVM backend for the Kotlin compiler, runtime implementation, and native code generation facility using the LLVM toolchain. It is primarily designed to allow compilation for platforms where virtual machines are not desirable or possible (such as iOS or embedded targets), or where a developer is willing to produce a reasonably-sized self-contained program without the need to ship an additional execution runtime.
In a nutshell, it allows to write code in Kotlin, which then can be compiled to iOS binary.
While writing iOS applications purely in Kotlin doesn't seem to be a nice idea, this possibility opens opportunity for sharing the business logic between iOS and Android applications in form of shared library written in Kotlin.
This is not really multiplatform development tool, but it allows you to place the common business logic into one codebase, and then share it in form of native library between platform-specific applications (iOS and Android particularly). Advantages of the shared codebase are obvious: less code, faster development, easier to maintain. Also, common codebase for business logic entails common set of unit tests for it.
I'm an iOS developer with 10 years of experience. During last year I'm working on an Android Wear (smartwatch) project as a Team Lead. Our project has Android and iOS streams, and we seek for some cross-platform approaches, which allow to share some codebase between platforms, while remaining applications developed with native tools.
- Kotlin vs Swift. What's in common
- What is Kotlin-native
- How to make iOS framework implemented in Kotlin
- Sample of the application for iOS and Android, with shared library in Kotlin.
- Nice&ugly things around development in Kotlin for iOS.
Great idea! I'd love to hear about your experiences with Kotlin/Native and whether the approach to use it for a common business logic layer is really applicable for large commercial projects already. How do you embed these libraries in your Xcode project?