7 ms·
Hopefully they'll allow it to be used inside app WebViews. Nitro is already great, but it's disabled inside apps.
by untog 13y ago
Hopefully they'll allow it to be used inside app WebViews. Nitro is already great, but it's disabled inside apps.
- frik 13y agoThis, and please enable WebGL support too [1] and give some love to the Webkit blog: https://www.webkit.org/blog/ https://www.webkit.org/blog/ [1] it's already in iOS since v4, but only activated for iAds
- eridius 13y agoThe only way any JIT at all will ever be allowed inside of UIWebViews is when UIWebView makes the jump to WebKit2, i.e. using a helper process to actually run the web content.
- dunham 13y agoThey might be able to handle it with a remote view controller. An existing iOS technology that allows for a view controller that fronts an out-of-process application. This is used for the mail composer and facebook sharing. See: http://oleb.net/blog/2012/10/remote-view-controllers-in-ios-6/ http://oleb.net/blog/2012/10/remote-view-controllers-in-ios-... (I suspect there are some constraints on how a remote view controller can be used, and they'd have to do some additional work to shunt in NSURLProtocol and all.)
- eridius 13y agoThat's quite unrelated. That's a technology that allows for e.g. the Mail compose screen to run out-of-process while still compositing into the same layer hierarchy as the host application and receiving touches. This not only allows restricting access to Mail accounts to the daemon that runs the remote controller, but also prevents the host application from doing things like hiding the mail compose controller behind another view and forwarding touches to it, so a press on an unrelated button actually triggers an email send. WebKit2 is done differently. The UIWebView still handles all the user interaction and whatnot, and it talks to the Web Process to send it requests (e.g. "load this URL", "run this JavaScript in the context of the page", etc). I'm not quite sure how the compositing of the web content works, but it's not the same system as remote view controllers.
- 0x0 13y agoThere's stuff here about a UIRemoteWebViewController: http://oleb.net/blog/2012/10/more-on-remote-view-controllers/ http://oleb.net/blog/2012/10/more-on-remote-view-controllers... https://github.com/nst/iOS-Runtime-Headers/blob/master/Frameworks/UIKit.framework/_UIRemoteWebViewController.h https://github.com/nst/iOS-Runtime-Headers/blob/master/Frame... https://github.com/nst/iOS-Runtime-Headers/blob/master/Frameworks/UIKit.framework/_UIServiceWebViewController.h https://github.com/nst/iOS-Runtime-Headers/blob/master/Frame...
- eridius 13y agoPossibly interesting information, but still not actually relevant to WebKit2.
- dunham 13y agoI might not have been clear in my grandparent post. I wasn't proposing this as a means to WebKit2. (I don't know what WebKit2 is.) I was suggesting this might be a way to get JIT support in native apps with the current iOS WebKit, by running the entire UIWebKit out of process. However, I have no idea if there are enough hybrid apps out there, with javascript performance issues, to justify going to the trouble of doing this.
- eridius 13y agoAh. Well, it's a cute idea, but it won't work with UIWebView. Besides the fact that existing apps already rely on the fact that UIWebView isn't remote (because they can muck about with various view properties of it, including direct access to its UIScrollView), UIWebView also exposes at least one synchronous API (-stringByEvaluatingJavaScriptFromString:) and synchronous APIs are no good when doing stuff out-of-process. It also has a delegate that runs in a synchronous mode (e.g. it's asked questions it has to answer by returning a value, instead of just being notified of events or using a callback-based response), and that's the same problem as synchronous APIs (because now the remote process has to block waiting on a response from UIWebView). WebKit2 is an existing effort by Apple to do out-of-process rendering. Various desktop apps already use it, including Safari, Mail, and iBooks. It features new APIs for doing everything, because it's all asynchronous. If third-party iOS apps gain out-of-process rendering it will be through WebKit2 and not some attempt to port UIWebView to the remote view controller system. Incidentally, the same synchronous issues with UIWebView that I mentioned above suggest that porting to WebKit2 is a non-backwards-compatible change. If Apple makes this change, I would guess that either they'll introduce a separate UIWebView class that's used for WebKit2 and leave the existing UIWebView alone, or they'll give UIWebView two modes, a WebKit mode and a WebKit2 mode, and whichever mode it uses will be selected at initialization time (and using a WebKit method on a WebKit2 UIWebView would be an error, and vice versa). Either way, apps will have to be rewritten to take advantage of WebKit2.
- ksec 13y agoI thought the latest Safari (Desktop at least) were already on Webkit2. And i know Safari on iOS7 tends to be running one cycle behind ( Correct me if i am wrong ) So may be we get Webkit2 for iOS 8?
- ksec 13y agoAfter Further Digging, it turns out WebKit2 has been a private framework in both OSX and iOS. But on OSX it has been extremely unstable. It wasn't until Maverick did the process per tab came and stability improves. I guess Apple still needs to work on for iOS due to its heavy memory usage. So hopefully, they will come in iOS8.
- cclogg 13y agoOh man yeah... UIWebView's have been left in the dust for a while now lol (and Apple probably has a reason for it unfortunately).
- mmastrac 13y agoThe reason is basically that you can't easily provide a guaranteed W^X [1] environment alongside a JIT in the same address space -- that is unless you write a ROP-based JIT. [1] http://en.wikipedia.org/wiki/W%5EX http://en.wikipedia.org/wiki/W%5EX
- TazeTSchnitzel 13y agoI thought the problem was code-signing, with Safari and only Safari authorised to use JIT.
- mmastrac 13y agoIt is -- code-signing is how they enforce W^X. Only code loaded from signed applications is given pages with execute permission, and those pages are denied write access.
- eridius 13y agommastrac is correct, the problem with JIT is W^X. The default sandbox for iOS processes prevents marking any page as executable that has ever been marked as writable. Safari is not "authorized to use JIT" so much as it has a special sandbox that lifts this restriction. It's not about code-signing, it's about the security provided by W^X. If it was merely about code-signing, the JIT could simply codesign its output using a certificate provided by Apple for this purpose.
- mikeash 13y agoThere's nothing that prevents W^X and JIT from coexisting. All the JIT has to do is change the permissions on the generated code after generating it so that it becomes executable instead of writable. W^X just says that any given chunk of memory cannot be both writeable and executable at the same time. What Apple does on iOS goes beyond W^X. They give you a one-way trap door, where you're not allowed to mark any memory as executable, ever, once it's marked non-executable. (Obviously, there is an exception made for the OS facilities that actually load your code from the disk, and an exception made for Safari's JIT, but us mere mortals don't get access to that stuff.) As for the reason, it's hard to say. It's probably because of code signing and Apple's desire for control to prevent you from downloading and running unreviewed, unapproved code, although even that doesn't entirely make sense, because you can always embed an interpreter and download and run code in that.
- nobodysfool 13y agoHopefully they will allow you to ship a browser that contains a JIT. Apple doesn't currently allow that, so most browsers perform pretty much the same on iOS.
- JohnTHaller 13y agoApple doesn't allow you to ship a browser with its own JS engine full stop, let alone JIT. So every browser on iOS is just a fancy UI over the hobbled Safari engine with no Nitro. So there's Safari on iOS which is full speed, and then every other browser on iOS which is hobbled speed. This is by design and unlikely to change.
- e15ctr0n 13y agoThis is the very reason why Mozilla refuses to release a Firefox version for iOS[1]. Mozilla would like to ship Firefox with its own rendering engine, Gecko, while Apple policy dictates that all browsers on iOS are required to use WebKit[2]. [1] http://www.cnet.com/news/mozilla-says-no-plans-to-return-to-ios/ http://www.cnet.com/news/mozilla-says-no-plans-to-return-to-... [2] http://thenextweb.com/apple/2013/04/04/will-chrome-for-ios-be-able-to-use-googles-new-browser-rendering-engine-blink/ http://thenextweb.com/apple/2013/04/04/will-chrome-for-ios-b...
- anon1385 13y agoDoesn't that apply to FirefoxOS as well? You can't write a JIT in Javascript. So for example Google wouldn't be able to port Chrome with V8 to FirefoxOS, as far as I know.
- e15ctr0n 13y agoFirefox OS apps are written in HTML5, Javascript and CSS for which there is full-blown support by the rendering engine and the Javascript engine.
- 13y ago
- namuol 13y agoAnd open the door for high-performance, "write-once-run-anywhere" app development? Doubtful.
- deleted 13y ago[deleted]
- threeseed 13y agoSorry but I've not once used a HTML5 mobile app that ever convinced me it was the future of mobile development. In fact I far prefer companies serve me the full desktop site.
- untog 13y agoThere's a chicken and egg problem here. The OP said "maybe this will allow us to make high performance apps" - given that it currently isn't possible, it isn't very surprising that you haven't seen any great, high performance apps. As for preferring the desktop sites, I'm afraid you are in a minority there.
- Iftheshoefits 13y agoAt what point do we stop calling it a "browser" and start calling it "a crippled, inflexible OS?" Relying on the browser as the operating environment in which to run any and every kind of application seems like a misguided a path to take. At some point the browser would have to become a kind of middle-man between the underlying OS and the end-user. There are very few good reasons to prefer "web apps" over native apps in any environment.
- untog 13y agoI don't think anyone thinks that the browser is the perfect medium for something like this. But native development is still extremely costly, because every platform has it's own language and environment. If all the device manufacturers come together tomorrow and propose a cross-platform native programming platform then I'm all for it. Until then we'll rely on HTML.
- United857 13y agoI remember when everyone took Microsoft to task for their "private" APIs in Windows, deep IE integration, etc to give their own apps an advantage,and forced them to level the playing field. Why is no one up in arms about Apple doing essentially the same thing with Safari vs. UIWebView?
- th0ma5 13y agoI wanted to get into iPhone development, and I kept looking back thinking I was inept at Obj-C, and I may well still be, but thank you for saying this, it reminded me that my ideas that mixed local and remote content and web technology made me quickly realize that WebView was a second class citizen, and I would've needed to reimplement a whole browser to make what I wanted on the iPhone. So I switched to Android where the WebView is a better object, although it would be nice to have an embedded Chrome based web view.
- untog 13y agoFYI there is a Chrome-based WebView in Android 4.4 and up. So, it'll be a while before we can rely on it, but one day...