Tuesday, June 16, 2015

Apple’s Bitcode Telegraphs Future CPU Plans

Interial Lemon wrote on Medium Apple’s Bitcode Telegraphs Future CPU Plans "The biggest announcement at this week’s WWDC is one hardly anyone noticed. During the Platforms State of the Union on Tuesday, Andreas Wendker briefly mentioned Bitcode, describing it as an opportunity for future compiler optimizations to be applied to already-submitted apps. He also mentioned that it allows apps to be future-proofed by letting the store add support for future CPU features without developers having to resubmit."

And in between the front and back ends sits the LLVM IR, now known as Bitcode. LLVM turns an app’s source code into Bitcode, and then turns that Bitcode into an executable app. This design makes it incredibly simple to add support for new languages (front ends), and for new CPUs (back ends). While Bitcode itself can’t run on anything, it can be transformed into any supported CPU architecture, including ones that didn’t exist when the app was submitted.

Watch SDK apps must be submitted from day one as Bitcode. iOS 9 app submissions will default to Bitcode, and it will become mandatory in the future. OS X was not mentioned–an increasingly apparent trend.

I had kind of forgotten that llvm had it's own bytecode (obviously it had it's own internal representation, but I didn't realize it was so public like the JVM) though that's kind of it's main purpose. I didn't realize at all that watchOS apps were submitted in this representation and missed that iOS apps will be too as of iOS 9. That's quite interesting. I've seen other attempts at this, e.g. OSF's ANDF but they never went anywhere. It had seemed that virtual machines had won in this space (whether emacs lisp, java vm, python, etc.) but real compilers would be much much better. I hope this speculation is right.

No comments: