32
TiConf NYC JEFF HAYNIE @jhaynie

TiConf NYC 2014

Embed Size (px)

DESCRIPTION

Keynote presentation by Jeff Haynie for Titanium Conference NYC held on May 10, 2014.

Citation preview

Page 1: TiConf NYC 2014

TiConf NYCJEFF HAYNIE@jhaynie

Page 2: TiConf NYC 2014

The Titanium Community

Page 3: TiConf NYC 2014

TITANIUM IS GROWING UP

Page 4: TiConf NYC 2014

NUMBER OF UNIQUE MOBILE DEVICES

250,000,000

Page 5: TiConf NYC 2014

NUMBER OF REGISTERED TITANIUM DEVELOPERS

580,000

Page 6: TiConf NYC 2014

NUMBER OF CLOUD API REQUESTS

28,000,000,000

Page 7: TiConf NYC 2014

FORTUNE 100 COMPANIES USING TITANIUM

68% of F100

Page 8: TiConf NYC 2014
Page 9: TiConf NYC 2014

The road ahead

Page 10: TiConf NYC 2014

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)

Page 11: TiConf NYC 2014

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

Page 12: TiConf NYC 2014
Page 13: TiConf NYC 2014

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)

Page 14: TiConf NYC 2014

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)

Page 15: TiConf NYC 2014

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)

Page 16: TiConf NYC 2014

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()

Page 17: TiConf NYC 2014

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

Page 18: TiConf NYC 2014

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)

Page 19: TiConf NYC 2014

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.)

Page 20: TiConf NYC 2014

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

Page 21: TiConf NYC 2014

Hyperloop iOS Metabase example

Page 22: TiConf NYC 2014

Hyperloop Java Metabase example

Page 23: TiConf NYC 2014

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

Page 24: TiConf NYC 2014

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

Page 25: TiConf NYC 2014

Hyperloop DemoGENERATION 4 COMPILER (H4)

Page 26: TiConf NYC 2014

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

Page 27: TiConf NYC 2014

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

Page 28: TiConf NYC 2014

Hyperloop in Ti.Current

Hyperloop is already being used in Ti.current!

URLSession API in Titanium 3.2CoreMotion API in Titanium 3.3

Page 29: TiConf NYC 2014

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

Page 30: TiConf NYC 2014

TO MEMORABLE EXPERIENCES

Page 31: TiConf NYC 2014

Thank YouJEFF HAYNIE@jhaynie

Page 32: TiConf NYC 2014