Upload
jeff-haynie
View
1.960
Download
4
Embed Size (px)
DESCRIPTION
Keynote presentation by Jeff Haynie for Titanium Conference NYC held on May 10, 2014.
Citation preview
TiConf NYCJEFF HAYNIE@jhaynie
The Titanium Community
TITANIUM IS GROWING UP
NUMBER OF UNIQUE MOBILE DEVICES
250,000,000
NUMBER OF REGISTERED TITANIUM DEVELOPERS
580,000
NUMBER OF CLOUD API REQUESTS
28,000,000,000
FORTUNE 100 COMPANIES USING TITANIUM
68% of F100
The road ahead
Upcoming Titanium Release
3.3.0 – targeted for end of June150+ bug fixesContinued performance & parity improvementsImproved CLI capabilities:
Modules buildPush to device is default (no iTunes sync)Improved intelligent prompting
Improved Studio Packaging (smaller, more robust)
Ti.Next
Next major release of Titanium (aka 4.0)Significant re-architecture of Titanium(Mostly) same APIIncredible performance boost and reduction in app sizeImproved ExtensibilityWindows support
Ti.Next Foundation
Foundation of Ti.Next is a new compiler, built from the ground up for performance, extensibility
Open Source under Apache Public License v2http://github.com/appcelerator/hyperloopOver a year of R&D already on Hyperloop (4th generation compiler under development)
Hyperloop fundamentally changes game
Hyperloop will allow mixed modes of integration:Titanium traditional (all-in)Titanium in NativeNative in TitaniumTitanium in other frameworks (Phonegap, Xamarin)Pure Native (Hyperloop only)
What is Hyperloop?
Hyperloop turns JS code into native code by mapping the native APIs into JS syntaxHyperloop will be (mainly) used by Titanium platform developers to build Titanium APIs or modulesA more traditional compiler architecture:
Front-end (parse and transform JS AST)Back-end (generate native, platform specific code)+Metabase (metadata about target platform)
Hyperloop iOS Example
“use hyperloop”
var view = new UIView(CGRectMake(100,100,50,50));
view.backgroundColor = UIColor.redColor();
var window = new UIWindow();
window.addSubview(view);
window.makeKeyAndVisible()
Hyperloop Front-end
Front-end uses UglifyJS to turn JS code into an AST and then perform transformations on the code to make it more suitable for native generation
Example of Front-end transformations
Foo.bar = 1 Foo_set_bar(1)
Foo.bar()Foo_bar()
var foo = new Bar()Bar_constructor()
foo.bar(1)Bar_bar(foo, 1)
Hyperloop Back-end
Back-end generates C/C++ code for target platform
~90% of the back-end code is reusable for all platforms supported10% is basically specific syntax for things like calling methods, properties, etc. and other platform specific nuances (differences in file extensions, etc.)
Hyperloop metabase
Defined platform APIs in JSON formatAutomatically generate for all platforms supportedLarge tree of all supported APIs (classes, functions, types, etc.)Supports both C and platform specific languages (Objective-C, Java, etc.)Uses Clang (+platform specific tools) to generateRich metadata about the platform
Hyperloop iOS Metabase example
Hyperloop Java Metabase example
Hyperloop JS engine
Unified JS engine for all platforms based on JavaScriptCore
iOS 7.0+ comes with engine installedPort for Windows and Android
Performance testing showed JSC was basically native speed
Hyperloop code re-writing
Huge blocks of code will be optimized into pure native code generationNo penalty for “JS bridge” like in Ti.currentJS engine runs on main UI Thread:
No thread context switching / creation overheadWill provide background worker for asynchronous non-blocking tasks
Hyperloop DemoGENERATION 4 COMPILER (H4)
Ti.Next
Titanium APIs are being re-written using Hyperloop JS syntax and compiled using Hyperloop compiler
Titanium APIs (and native APIs) will be first class JS objectsGoal is to generate API interfaces, test cases from API documentationFull Node.js require implementationWill likely deprecate platform specific APIs and provide a compatibility moduleLikely will reduce size of overall APITitanium APIs will use module design
Ti.Next Modules
Migration path for modules (still trying to determine)Packaging likely will change and modules will be expressed in Hyperloop syntaxPossibility of a module compatibility shim
Hyperloop in Ti.Current
Hyperloop is already being used in Ti.current!
URLSession API in Titanium 3.2CoreMotion API in Titanium 3.3
Ti.When?
No specific date yet – trying to finish gen4 compiler:
30-45+ days from having enough completed for all 3 major backends (iOS, Android, Windows) before Ti.Next API framework design can startLikely 6-9 months from this pointTarget is beta before end of year / could be soonerLikely Windows Developer Preview Release first
TO MEMORABLE EXPERIENCES
Thank YouJEFF HAYNIE@jhaynie