TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

If Swift runs on Linux, and Android is Linux, won't Android have the most apps?

4 pointsby pjbrunetover 9 years ago
Theoretically, could Android run "all the apps" natively if they add support for Swift? Conversely, if Apple forked Android, could they do the same thing in reverse? I'm not taking sides, just curious what the experts think.

3 comments

on_and_offover 9 years ago
It is relatively easy to produce NDK outputs from Swift : <a href="https:&#x2F;&#x2F;github.com&#x2F;swift-cc&#x2F;tools" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;swift-cc&#x2F;tools</a> That&#x27;s not very useful though. NDK is by design very limited and can&#x27;t interact with almost any of the platform APIs<p>The Android framework team could theoretically make the necessary work to allow Swift code to :<p>-dialog with the framework APIs (so we would need need some kind of API bridge)<p>-compile to oat or bytecode format so that it can be read by ART (the vm used by android).<p>They would have to throw away and restart from scratch a lot fo the tooling though.<p>The Android frameworks team discussed the adoption of a new language during the fireside chat of the android dev summit.<p>The language in question was Kotlin (which would IMO a much bigger contender as the next language for Android). Their response was that adopting a new language means a massive amount of work for them and some very hard questions to answer like &#x27;what about the people that still need&#x2F;want to write in Java ?&#x27;.<p>Adopting Kotlin is not in their plans right now (it might change if in 2 years 90 % of the devs write their apps in Kotlin), especially since Kotlin already outputs bytecode, so it is 100 % compatible with the java APIs of Android.<p>This is even far less likely to happen with Swift :<p>-Apple controls the future of the language, Google can only lose from such a relationship.<p>-It is not compatible with the java APIs.
评论 #10694113 未加载
jakejakeover 9 years ago
The language will compile, but all of the UI frameworks for iOS aren&#x27;t available on other platforms.<p>It strikes me as similar to how .NET is cross platform. Command line apps will run, but anything with a GUI would have to be written with a cross-platform UI kit.
评论 #10682064 未加载
tiredwiredover 9 years ago
Swift is just a programming language not an OS. You can program in C&#x2F;C++ on Android and iOS if you want to and forget about Swift.