Blog Post: Swift on Android: the Past, Present, and Future#1405
Blog Post: Swift on Android: the Past, Present, and Future#1405marcprux wants to merge 2 commits into
Conversation
|
|
||
| The earliest published account of Swift running on Android is Romain Goyet's October 2015 article, *Running Swift code on Android*,[^goyet] which cobbled together a custom toolchain built from the not-yet-open-source compiler to produce an ARM binary that could execute on a rooted device. The article documents getting `puts("Hello, world!")` to run from `adb shell` and stops there. Despite the post's conclusion of "That was fun, but is of course useless", it established two facts that shaped the coming decade: Swift's LLVM-based codegen was suited to Android's various target architectures, and, with a bit of jiggery-pokery, the Swift runtime could be made to run on top of Android's Bionic libc with some effort. | ||
|
|
||
| [^goyet]: Romain Goyet, "Running Swift code on Android," October 14, 2015: <https://romain.goyet.com/articles/running_swift_code_on_android/>. This article was published *before* Swift was open-sourced (December 3, 2015) and relied on toolchain bits extracted from the then-proprietary Xcode distribution. It is, to our knowledge, the first published demonstration of Swift code executing on an Android device. |
|
|
||
| With Swift 6.3 shipped, the question shifts from "is Swift on Android possible?" to "what can it do today, and where are the boundaries?" | ||
|
|
||
| ### What Works |
There was a problem hiding this comment.
Sorry, but like many I am interested in understanding how much of the recent work in ownership and especially actors and concurrency is supported here and how it would be mapped to Android / Kotlin’s coroutines and concurrency story.
There was a problem hiding this comment.
I agree that would be a very interesting topic, either for a future post or for the WIP documentation (swiftlang/swift-android-examples#40). I've kept this post intentionally less technical and more historical/cultural.
|
|
||
| We particularly welcome contributions from developers shipping production Swift code on Android. Bug reports from real apps help identify real-world usage patterns that contrived unit tests do not. | ||
|
|
||
| ## The Final Frontier |
There was a problem hiding this comment.
I would suggest not calling it “final” as if there’s nothing else to be worked on 😅 it gives of a somewhat closed end impression we might want to avoid?
There was a problem hiding this comment.
I meant it more in terms of consumer platform coverage, Android being the final frontier of the five major consumer operating systems. I'm happy to rephrase or remove the callback as consensus deems appropriate.
|
Fascinating read, thanks for sharing this! Earlier in the post you reference the first app in the Android play store. Was wondering if in the later section there could also be mention of the current state of things i.e. what Swift apps if any are currently available for Android? |
compnerd
left a comment
There was a problem hiding this comment.
This document strips out mentions of a large number of folks including myself:
- Orlando Bassotto
- Tom Birch
- hpux???
- Brian Geziak
- Saleem Abdulrasool
Zhuowei Zhang was the first one to put together something with the original toolchain, then the set above did the proper port with first porting to Linux ARM, and then Android.
You are indeed included in the draft. But those others were not — I was mostly going by publicly-posted accounts and independent projects. I'll do a bit more research and see if I can put together a nice summary of their contributions, but I would appreciate any suggestions you might have. |
|
IIRC, I had added a fair amount of that back history in one of the drafts about the historical context. |
|
Yes, here: https://hackmd.io/qWhp1tUhT3iv_sKDQV-s6g I'll work on rolling that into this draft. |
Blog post: Swift on Android: the Past, Present, and Future