4 ms·
Chromium is the best UI toolkit ever created. What exactly are the arguments against Electron? It's slow to render? Wrong, Electron (Chromium) renders faster t
by zelly 6y ago
Chromium is the best UI toolkit ever created. What exactly are the arguments against Electron?
It's slow to render? Wrong, Electron (Chromium) renders faster than Qt. The Skia engine is optimized to an extent that these other toolkits cannot compete with. It even has a Vulkan backend now.
Single threaded? The render process is--you can use any native multithreaded code you want in another process.
Memory? It's 70MB. That's nothing nowadays. Modern OSes can page it in and out when the application is idling. A lot of these other toolkits are quite heavy too, especially JavaFX in my experience. Also what happens when you need a webview in one of these other toolkits? In Qt you get an embedded instance of Chromium[1] so not only do you have the 70MB of Chromium, you also have the Qt runtime (!).
The reason the Electron app you're using is slow or hogs giants amount of memory is the Javascript code itself is slow. Yes, Slack is a slow monster, but it's a giant codebase that does things that would be simply impossible in Qt, GTK, Swing and others. There's a reason we never saw these types of apps when the only frameworks were Qt and others.
[1] https://doc.qt.io/qt-5/qtwebengine-overview.html https://doc.qt.io/qt-5/qtwebengine-overview.html
- deleted 6y ago[deleted]
- roel_v 6y ago"but it's a giant codebase that does things that would be simply impossible in Qt, GTK, Swing and others. " Like what?
- zelly 6y agoDynamic, server-side rendered views HTML snippets rendered for free (no need for an external HTML renderer) Lots of little things like <video> being enough to embed a video into the view versus subclassing a C++ Qt class or whatever song and dance it is in other frameworks. It's productivity that's the killer feature. You can theoretically do everything Electron does in Java Swing, but it would require reimplementing most of the web platform.
- roel_v 6y agoNot sure what the point is on the first two - you wouldn't even need that with a non crap ui framework. Video - I drag and dropped video players onto UI forms 20+ years ago. <video> is a joke - you need something like video.js to make it functional in the real world and at that point, good luck on 'simplicity'. Adult sites have entire teams working on their video players, how messed up is that? The problem today (old fart mode on) is that when all you have is a hammer, everything looks like a nail. And it seems that people don't even just only have a hammer, they don't even know what things that are not hammers look like.
- zelly 6y ago> Not sure what the point is on the first two - you wouldn't even need that with a non crap ui framework. Server-side rendering is a business need not a programming need. A company like Spotify may want to change the UI without updating the installation. To do this on the web platform is a well-supported pattern. To do this with Qt you'd have to implement your own HTML- or JSX-like framework on top of Qt (like Hyperview does for mobile). Companies that use Electron can just move faster and crush competition. That's why there are billion dollar companies based on Electron programs and Qt people get excited about it being the software behind the radio volume button on the latest model fishing boat.
- byko3y 6y ago>Server-side rendering is a business need not a programming need. A company like Spotify may want to change the UI without updating the installation The topic is about general desktop GUI applications. Some users of desktop applications don't even have internet connection e.g for security considerations. Tell me more about changing application UI without internet connection.
- roel_v 6y ago"A company like Spotify may want to change the UI without updating the installation" I did that 20+ years ago too and no I didn't need an 'HTML- of JSX-like framework'. Again, when all you have is a hammer...
- w4tson 6y agoIntelliJ is written in swing. It’s about the most complex piece of desktop software you’re ever going to use. It’s objectively orders of magnitude more complex than a messaging app. Heck, it used to have messaging built in at one point I remember! Also, I’ve done a bit of Qt and while I don’t have an example (I’m sure someone else could supply one- finance back/front office?) it’s predominantly used with C++ which scales to millions of likes of code.
- fctorial 6y ago> it used to have messaging built in at one point What year?
- byko3y 6y ago>Chromium is the best UI toolkit ever created. What exactly are the arguments against Electron? Because it looks ugly (i.e. non-native) on pretty much every platform. Qt has different levels of success at that, having most problems with macOS and Android. Also, there's Qt Quick, which lies somewhere in the middle between classic Qt and Electron. >It's slow to render? Wrong, Electron (Chromium) renders faster than Qt. The Skia engine is optimized to an extent that these other toolkits cannot compete with. It even has a Vulkan backend now The reason why classic single-threaded GUI toolkit are the way they are is because you can perform a custom reactive drawing or just reactive UI update in a blink of the eye, so user won't notice any delay. I know there are some bad examples like java-based IDE bloatware, but there are good examples like... Chromium! However, you cannot develop Chromium with Chromium, but you can develop something similar to Chromium with Qt. >Memory? It's 70MB Haven't seen Electron application using less than 200 Mb of memory. For example, launching Skype plus chromium SPA takes 550 Mb of RAM on my system. JavaFX has similar problems. >Slack is a slow monster, but it's a giant codebase that does things that would be simply impossible in Qt, GTK, Swing and others Like what? I'm not aware of any special Slack's features that could be hard to implement using classic GUI toolkits.
- zelly 6y agoThe old Skype client using Qt was similar to a Slack using a classic GUI framework. Compared to Slack it was barebones. You had a list of conversations and a view for the conversations themselves. I'm not saying it's bad; I'd probably prefer it in fact. But it's not the same product as Slack. This comes back to my point about Electron vs. others, maybe the reason Electron apps are slow is because Electron apps typically have more functionality. The easiest way to make a program faster is to remove code. > However, you cannot develop Chromium with Chromium Why not? You can run Visual Studio Code in the browser and edit the Chromium source code. Perhaps, given sufficient memory, you can also run clang in the browser (WASM) so you can compile and link in Chromium too. > Because it looks ugly (i.e. non-native) on pretty much every platform. I'm not sure if you're talking about Electron or Qt because this statement applies equally well to both. Electron, Qt, Swing, JavaFX, Flutter all take the approach of drawing every pixel themselves, not using any "native" widgets rendered by the OS vendor. Anecdotally all the Electron apps I've used have been beautiful whereas the Qt/GTK ones look stuck in the 90s.
- avasthe 6y agoWho could have done An IRC client With emojis and fluff In those lowly QT, GTK and native stuff We the undersigned Software craftsmen tell Webshit is the best
- amw-zero 6y agoI used AOL Instant Messenger in the year 1997. Chromium didn't even exist yet, right? You think that HTML and CSS somehow unlocked some magical powers that had never existed before? That's pretty surprising given that DOOM came out in 1993 and did things several orders of magnitude more advanced than Slack's UI. I mean really. How would any of Slack's UI be impossible in QT? And conversely, if HTML is so good, why have we never actually written any applications with it, and instead rely on templating languages?