Hacker News new | ask | show | jobs
by mcrider 5231 days ago
Whoa, didn't know Titanium compiles javascript into native code. Cool! But Phonegap has a pretty rich set of plugins and its relatively painless to extend Phonegap's functionality with a plugin. Did you have to hack in your geofencing capability? There's no plugin framework?
2 comments

No, Titanium doesn't compile to native code. He's using that as shorthand for "Titanium uses JavaScriptCore to implement a bridge that lets your JavaScript call native code". Your JavaScript remains interpreted (and will not be JIT compiled, as in Safari, since your app won't have the JIT entitlement) but in my testing of JSCore it's not generally a bottleneck.
There is a module framework, but since the Titanium framework already created a CLLocationManagerDelegate in their GeolocationModule, I didn't see a clean way of adding geofencing in a separate module. So I hacked it right into the existing GeolocationModule. Again, the performance difference between native code and rendering HTML5 is huge, and that's why we decided against PhoneGap. Personally, if HTML5 wrappers were the only option, I probably would've just sucked it up and went native Obj C. Like someone else mentioned, there are a lot of challenges to making an HTML5 app perform like a native one.