With Swift open sourced, what would it take to make it work on the JVM?

I'm programming in Objective-C and Swift in the first place and realized that Apple is announcing Open Source Swift by the end of the year as a step to make it available to backend software. To quote Craig Federighi (SVP Engineering) in keynote article "We believe Swift is the language we will use to program applications and systems." The mention of systems programming and the mention that there will be libraries for Linux seems like a clear sign on the road to being used as a development language.

So my question is about two possible paths that might be required. On the one hand, the Swift page says that "Using the incredibly high performance LLVM compiler, Swift code is translated into optimized native code that gets the most out of modern hardware." This would mean that it has to be compiled for every target hardware I assume. Is this assumption correct?

On the other hand, if Swift was compiled to the JVM, I imagine that would lead to Swift adoption being much wider and faster as it can take advantage of the JVM's hardware independence.

I think my question is this: Are these two assumptions correct? Is it even possible to compile Swift to the JVM? If so, what advantages and disadvantages will it have its own code for each target hardware.

I'm curious to see if this is on the soccer field on how to think about this development for Swift.

+3


source to share


1 answer


LLVM IR can be used as a platform binary agnostic distribution method. Google does this with PNaCl. http://www.chromium.org/nativeclient/pnacl/introduction-to-portable-native-client



I don't know if the JVM provides advantages over LLVM IR, but not the same as locking into one exact binary format.

+1


source







All Articles