4 ms·
It's worth noting here that part of the problem is that the web is ideologically hostile to anything native. Consider: people complain a lot about Electron app
by mike_hearn 3y ago
It's worth noting here that part of the problem is that the web is ideologically hostile to anything native.
Consider: people complain a lot about Electron app bloat. Why can't Slack optimize a bit? Well, they have a lot of Mac users. One obvious way to optimize would be to incrementally port the most performance sensitive parts of their app to use AppKit so Apple's highly hardware-optimized UI toolkit handles those parts, and Electron handles the rest.
Problem: doesn't work. You can't embed an NSView into a Chrome renderer. This was once possible using the Netscape plugin API, but it was removed many moons ago and now you have to use HTML for everything. Electron is popular, plugins were popular, and Chrome could add these capabilities back and even do them better, but they don't because if your app is pure HTML then this maximally empowers the Chrome team. They can do lots of stuff to your app, and add value in various ways, and if the price of this is less efficiency or that some features become less consistent or even harder to implement then this is a sacrifice they are willing to make.
The result is that a lot of these discussions go circular and just become moanfests, because the ideological constraints of the platforms are taken as unarticulated givens: immovable objects that are practically laws of nature rather than things that can be changed.
There is no specific technical reason why you can't have apps that start out as web apps but incrementally become native Mac or Windows apps as user demand justifies it, it's just not how we do things around here.
- acdha 3y agoThere’s definitely a lot of friction there but I think it also hits the cost shifting aspect pretty hard: it wouldn’t be that hard for, say, Slack to use a native Mac app which embeds WebKit but they want to save money by only supporting Electron. For a small startup that makes sense but given the collective petabytes of RAM and power used, it feels like the balance should have shifted at some point.
- mike_hearn 3y agoI don't think WebKit can embed NSViews either? At least not unless you modify the source code, iirc there are still some bits of the old Netscape plugin code still there. The hard part isn't native embedding web, it's that if you start with web you then can't easily stick a native view into e.g. an iframe.