3 ms·
So I'm not overly familiar with either JITs, Apple's policies or emulators, so this may be a stupid idea, but I was thinking: Apple does allow exactly one JIT o
by mort96 2y ago
So I'm not overly familiar with either JITs, Apple's policies or emulators, so this may be a stupid idea, but I was thinking: Apple does allow exactly one JIT on iOS, in its JavaScript engine. What, technically, is preventing anyone from writing a recompiler from PowerPC machine code for the Wii to ASM.js (or even WebAssembly) and then throwing JavaScriptCore at it? It's not gonna be as fast as a recompiler straight to native code I guess, but could it be significantly faster than interpreting?
From some quick Googling, it seems like JavaScriptCore is running with the JIT disabled in most apps, but surely e.g Chrome is running with JIT enabled. Convincing Apple to let you use JavaScriptCore with JIT enabled might be easier than convincing them to let one run one's own JIT.
- deleted 2y ago[deleted]
- robertjpayne 2y agoJavaScriptCore doesn't use a JIT when used in your own apps. When you embed a WKWebView it runs out-of-process and has JIT enabled. Without the entitlement you cannot execute any written memory by your own process. All 3rd party browsers today use WKWebView and add their own "chrome" over the rendered page. In essence Chrome/Firefox for iOS are really just Safari with custom chrome for bookmarks etc…
- mort96 2y agoWhat exactly is preventing you from making an off-screen WKWebView and pointing it at some bundled HTML/JS which allows the app to run arbitrary JS through some IPC? I guess App Store guidelines would come in the way, but I bet it it would be technically possible
- kevincox 2y agoIt is technically possible but the IPC will destroy you. You would need to transfer inputs and outputs as well as have JS shims to call it. Most of the code will be doing tons of memory accesses which will need to be transferred back and forth across the process boundary and orders of magnitude more cost. If you did want to try the best approach is probably to compile Dolphin to WASM and render via WebGPU. Then you can JIT WASM. But I suspect that the overall performance will still be lower. (Although a web version of Dolphin would still be super cool.)
- deleted 2y ago[deleted]
- voxic11 2y agoI don't think it would be as simple as compiling Dolphin to WASM. Since Dolphin itself implements a JIT compiler that emits native code you would need to also teach Dolphin to emit WASM code.
- SSLy 2y agoOther concerns raised by sibling comments aside, that'd amount to a new port effort, virtually equivalent to a web app.
- mort96 2y agoOh yeah it's a huge amount of work, I don't want to make it sound like I think people should "just" take Dolphin and port its JIT to JavaScript.
- londons_explore 2y agoBet there'd be interest in a web version of Dolphin. Dosbox-on-the-web has proved pretty popular, and a lot of old games are available on the web that way.
- deleted 2y ago[deleted]
- amelius 2y agoHonestly it would be more cool if developers for once started to boycott Apple here, instead of jumping through their hoops.
- mort96 2y agoMeh that won't happen until there are decent alternatives out there. Google's Android isn't such an alternative, and other options aren't supported by all the services people need to use.
- beeboobaa3 2y ago> Google's Android isn't such an alternative It absolutely is. Don't be delusional lol. Here's a video of dolphin running on android: https://www.youtube.com/watch?v=Tp-D4GvUxY4 https://www.youtube.com/watch?v=Tp-D4GvUxY4
- BiteCode_dev 2y agoYes, but you get more money out a single Apple customer than from 5 android users, and that's the problem of this alternative. It's about money, not technical capabilities.
- beeboobaa3 2y agoDolphin is free. 5x0=0. Then you have to consider the platform fees. So for android: One time fee of $20, yearly $0 profit For apple: Yearly fee of $100, yearly $-100 profit
- mort96 2y agoIt's an alternative if all you want is emulators on your phone of course. For me, Google Android isn't a meaningful alternative to iOS, simply because I trust Google even less than I trust Apple.
- SSLy 2y ago
- beeboobaa3 2y ago> What, technically, is preventing anyone from writing a recompiler from PowerPC machine code for the Wii to ASM.js (or even WebAssembly) and then throwing JavaScriptCore at it Self respect. At some point you have to recognize that the platform is hostile and abusive towards you, and it's not healthy to continue to engage.
- lioeters 2y ago> recognize that the platform is hostile and abusive That's how Apple lost me as a customer, who had been a life-long user since early Macintosh days. It's an example of enshittification, death by a thousand cuts. Shame what they've done to the legacy, but the magic has been waning for a while. The elves left a long time ago, replaced by greedy sneaky humans.
- madeofpalk 2y ago> e.g Chrome is running with JIT enabled. Convincing Apple to let you use Current Chrome iOS app uses Webkit and JavascriptCore. I believe Chrome uses WKWebViews and so can take advantage of JIT-enbaled JSC. As pointed out in the article, in the EU Apple has APIs and entitlements for other browser engines, including allowances for JIT. But as it's an entitlement you apply for, you'll only get it for web browsers https://developer.apple.com/documentation/browserenginekit https://developer.apple.com/documentation/browserenginekit https://developer.apple.com/support/alternative-browser-engines/ https://developer.apple.com/support/alternative-browser-engi...