Ask HN: Why aren't there any real alternatives to Electron?
I keep looking for alternatives to Electron, which wouldn't require such heavy resources to run, but my searches always seem to come up short. There are a number of solutions that are either dead or are not ready for production yet, such as React NodeGUI[0], Proton Native[1] or react-native-desktop-qt[2].
There's react-native-windows, but I'm not running Windows, and even if that did gain Linux compatibility it seems that they're quite focused on Microsoft-owned platforms.
Is "just stick Chromium into all your apps" seriously the best we can do as an industry? It's resource-inefficient to high heaven, not to mention that it's slow and doesn't integrate with the native platform styles at all. As a JavaScript developer, I'm quite surprised this is the best there is for cross-platform JavaScript development.
[0]: https://github.com/nodegui/react-nodegui [1]: https://proton-native.js.org/ [2]: https://github.com/status-im/react-native-desktop-qt
236 comments
[ 3.5 ms ] story [ 265 ms ] thread- No "currently playing" detection.
- No global hotkeys.
- Reduced noice canceling and other audio cleanup.
Maybe a few others that I can't think of off of the top if my head. But for me personally the browser version is way better. I don't want them snooping on what is running on my system, I have a global mute+unmute hotkey (that I trust and works for all apps) and I already have better processsing on my mic at the system level.
Resource usage is a problem but has become manageable over the years. See how pretty and efficient VSCode is. And honestly thank God we have electron, before that a truly cross platform ecosystem was limited to Java and that abomination Adobe AIR.
I'd add that when VSCode started to gain popularity it was common for a dev system to have only 8~16 GB of memory. In most cases that's now more than doubled.
Really? I still find it difficult to get a laptop with more than 16 GB of memory.
13" MBP maxes out at 16 GB. 14" does have 32 for $500 more, which might be ok for a company but is certainly a lot for me to spend personally just so I can run Electron apps comfortably. Non Apple laptops are similar.
If I'm buying a laptop instead of a Desktop, its for the ability to conveniently bring it with me when I'm not at home. For that, 13" is my preferred form factor. So at least Apple and Dell laptops, I have not seen one with more than 16 GB. I feel its unreasonable to expect me to sacrifice physical comfort just so apps can be written to use Electron.
If you want a MacBook Pro M1 with 32GB RAM, the total cost is easily twice.
I appreciate gaming laptops, but it cannot be a requirement to run some basic electron apps that very user needs day to day.
Why should it take more RAM to run teams htat it does to edit 8K video?
This is a response to how 32GB RAM is not as common in branded laptops (ThinkPad, MacBook Pro) as we'd like.
Perhaps you mean it shouldn't take 8-16GB RAM to run an Electron app?
It appears from this thread that 4GB RAM is often not enough.
The only reason Electron is popular is that company who shoot at multiplying their revenue need to have web apps - which brought up the demand and salaries of web developers. Web developers being in such a high demand means that people will learn more of web stuff over native.
At the beginning of my career I was equally doing as many Qt projects as web projects. Nowadays, when I'm targeting only the better paying clients, I do pretty much only web. The developer experience in Qt is significantly better than anything web related (even after QML got introduced).
Jobs in C++ / Qt pay significantly less than what I'm getting. Same for most Haskell / Rust jobs.
If the choice is dealing with the pile of crap that web development is and making less money, I'd go with the money.
Things are changing in regards to Haskell / Rust, thanks mainly to cryptocurrency. The amount of money generated by the speculation in the crypto world and the fact that a few projects use Rust / Haskell means we're finally getting decently paid jobs using nice languages.
Has anyone else noticed that, in defense of Electron, everyone always trots out this one example, but... that's it? Like, where are all these other magnificently efficient Electron apps? If it's that easy, surely there must be others. And yet...
For instance, I'm quite happy with Obsidian too, it's fast and snappy.
https://tauri.studio/
If memory serves, it reuses the OS default web view and any "backend" or system things are done in Rust.
Not sure you understood my initial comment.
Good day.
I think that's pretty normal and reasonable and certainly not trolling.
It'd be trolling if the intent was to gaslight.
Otherwise, toning down aggression is a virtue.
If this is what software development has become, then there's no way it won't end in total and utter disaster when people start to recognize the already all too common piss poor products that barely manage to do the absolute minimum and rebel against them. It may not be marketing department of the Sirius Cybernetic Corporation who'll be lined up against the wall first, but software developers when the revolution comes.
Crap. I'm now old enough to remember when computers were fast. :(
What's important to the majority of computing tasks is boring, doesn't need super computer sppeds or IoT sized products This lament is really narrow sighted.
Resources are cheap for the majority
Now if every device and app is built on Electron with such minimal effort then I'm not sure even resurrecting Moore's Law could keep up.
EDIT: Forgot to mention that if I configure the device to do 'hardware' assignment then it's not as bad a problem. (Yet at the cost of some flexibility.) So it suggests that the software level bindings are being loaded through this Electron abomination.
For functionality that does need additional configuration (like extra buttons, RGB colors), you will have to install a companion app and use it once.
There's no case where a peripheral will be non-functional unless a heavy electron app is permanently running alongside it, as the parent comment alleged. If there is, it is absolutely not the standard.
Sure, if you're OK with running only one or two applications at a time.
Also, if applications were written with care toward performance/resources, imagine how much more those applications could do?
And it's also unpleasantly clunky and heavyweight, with unpredictable unresponsiveness as GP notes.
I think they actually have a tool for discovering which extension is the bottleneck?
Either you have a massive codebase that outstrips every one I've ever worked on, or something is really busted there.
For me, I can live with it, but I definitely 'feel' it when I jump back into something native.
This was around 1997, mind you. The build from the IDE still took almost 2 hours to complete.
As it stands now, I still use IDEs. I try to disable every "convenient distraction" feature they have, but I've had had to settle for the fact that I can't make them work the way I want.
IIRC, in one of more recent versions of VS, hovering over a method param will show the type of the param. The same info that's already declared to the left of the param.
How is this helpful at all?
Even worse: There doesn't seem to be a way to even fine tune this. I don't need prompts in my face 100ms after I hover over something. They might be useful after 2000ms. But it seems to be all or nothing. I've been using Mads Kristensen's Disable Tooltips extension to preserve my sanity.
If you want to see ugly, open the Azure portal sometime. Hovering too long (e.g. 200ms) over an element may open up a bigger dialog, and if you hover even longer, you get an even bigger dialog that blocks out other things that I might want to look at. It also has a nasty habit of clickjacking my intended target because of this.
I think a lot of this garbage comes from this idea that you need to keep the user engaged for whatever metrics. The problem is that although this is fine for adverts and social media sites, this is exactly what you don't want for productivity. Unfortunately, it seems like these people change jobs/teams and end up bringing this mentality with them.
We use MyEclipse for a lot of our Java development and I found something in their latest release that gave me chills: selecting multiple lines of text in an editor will bring up a control to start a "CodeTogether" session. That can be disabled, but I really have to wonder about why selecting some code in my editor means that I need to "phone a friend."
The Azure Portal is absolutely spiteful. I've been using that as an object example of poor UI design for my junior developers. All of that work they've put in to make it responsive and I still have to hit F5 to see if my VM really started...
There is a trend to make UIs more and more noisy every release, to the point where you have to be engaged on everything.
Example #1: When I quit a Teams meeting, I randomly get asked to rate the meeting (unwanted behavior), instead of going back to the last application I have open (desired behavior)
Example #2: When I edit an Azure DevOps wiki page and paste a link into the text editor, I expect no other behavior than the typical paste behavior. Instead, I get a vestigial popup which steals focus and prevents me from typing or moving the cursor with the up/down keys until I hit Escape. Imagine if you have to link to multiple pages to this wiki. It completely kills my productivity by over 50%.
Example #3: When I use the mobile version of the Vivaldi browser, closing a tab should just bring me back to the last tab. It does that, but then has a pop-down dialog telling me I closed the tab, blocking the bottom of the browser. Dumb.
Example #4: Screenshots in Android. Instead of just flashing the screen once to indicate the screenshot was taken, it now adds more context-related garbage to the bottom left corner of the screen, sometimes blocking controls. Really dumb.
Example #5: Opening a Teams meeting. I click on the Outlook reminder to open the calendar invite, then click on Join Teams Meeting that brings Teams to the foreground, then opens the meeting window. It takes multiple clicks and open windows to just join a simple meeting, as well as multiple clicks to close all the open windows I don't need. I guess the idea of one click, one windows is too hard to figure out.
I wouldn't be so angry about this if there was a way to just disable some of these anti-features. And it's never just one thing. It when you use multiple applications during the day and you can never get into any kind of flow. It's just interruption after interruption, with zero regard to cohesiveness.
It's unfortunate that some UI/UX designers really do believe that the stuff that the FAANGs are doing is good design, because they end up perpetuating it through other software with little regard to the user or context.
The MongoDBCompass client comes to mind. It's a gigantic beast of an Electron application that takes almost 30 seconds to load up on first start. Simple things like CTRL-A will not select all the text in a textbox, but the entire rendered webpage instead. Or double-clicking some value in a document will shift the interface around and put it into editing mode, when all you want to do is just copy a value.
I've been going back to Robo3T lately. Sure, it has it's own UI/UX issues, but it doesn't feel like I'm fighting the tool all the time on really basic UI/UX stuff. And it loads up in less than a second. Never thought I'd see the day where I'd actual prefer a Java desktop app over something else.
Visual Studio feels like I am using a clunky old slow piece of software, to me. Takes forever to build and run the solution, hell it takes forever to even open a workspace.
Code feels blazing fast in comparison
Awwhhh why so glum? This sounds so alarmed, so fraught & bleak!
I don't see anyone as having a bead yet on what the final destination is, on what is right or perfect. I see change & innovation & exploration as necessary, ongoing, and this layering of platforms atop each other is part of that larger bigger quest for us all to learn what serves ourselves well, to figure out how we align.
Overall these Adapter layers are quite performant, quite fast, and they isolate rather than leak complexity quite effectively. Electron's doesn't have to invent a ton of stuff to create this pleasant, familiar environment for developers or users- the operating system is simply not that relevant, is easily adapted, by a pretty boring regular programming language (Node.JS) and the world's most popular multimedia page/resource system (the browser).
Right now, yes, we have the web platform as a layer above native in many cases, but I'm not sure that that is so alarming. Maybe it's transitional? The early smartphones were both enormously web first, decided to use something great rather than reinvent: the Palm Pre and original iPhone (which was webapps only). In modern times, there's ChromeOS, and Palm's webOS continues under new stewartship, mainly on TVs. If the complaint is layers of complexity, maybe we just need to get rid of proprietary & legacy platforms, & embrace the common, shared medium that all computing has. Or find new unifying better platforms!
In general, I see these new platforms as being extremely liberating, as helping reduce the complexity developers have to mess with, by offering a set of well-defined standards & well known constraints & behaviors. Rather than a complicated, particular OS tied to some specific devices, with it's own quirks, with ever evolving platform capabilities & changing toolchain
> If this is what software development has become, then there's no way it won't end in total and utter disaster when people start to recognize the already all too common piss poor products that barely manage to do the absolute minimum and rebel against them. It may not be marketing department of the Sirius Cybernetic Corporation who'll be lined up against the wall first, but software developers when the revolution comes.
Again I think moderation is good council here, but I also agree in principle that there is some awareness software can be a bit of a disaster, and it's visible that sometimes updates & "improvements" serve external interests not the users.
Where I differ is I see Electron as a fairly hopeful, possible open future for computing, that does embrace users, more so than most software. Most software is not malleable, not adaptable. Electron, on the other hand, offers the very slick, open ended DevTools Protocol for most every app, which allows users control & automation & expansion of software. We can write some userscript & change the behavior of webplatform & electron systems, which is hugely powerful, is a far fairer shake & far more liberty than most computing platforms, where apps are usually compiled down, fixed in form & nature.
This second paragraph really brings me back to where we started: I don't think we have a bead yet, as a larger world. It feels like there's so much discovery, so much understanding to develop. What makes me hopeful is groups like https://wicg.io , which try to understand & consider how we might do better, which work to build open standards for the internet, for our shared multimedia pla...
Nah. It means many projects don't have strict performance requirements. Mediocre performance, high impact on battery life, slower startup times are OK for these folks. In return they gain cross platform support, quicker development cycles, etc.. There's nothing wrong with making these tradeoffs.
I would argue there's something wrong with giving customers a shitty experience.
If you think about ui in OSes, they are different, quite a bit. Still similar in some way, but different.
Given that, one solution when you have similar things that are actually different (e. g. PS3 and PS5 are both consoles that run videogames, from the same company, but are incompatible),is to ship a vm. Make things run there and use it.
Chromium is that VM.
So now Edge is a Chromium fork, which is sad.
They didn't fail, they quit. You can't build something as enormous and complex as a modern and performant web browser that keeps up with modern standards for only 3.5 years.
They did the same with Windows Phone but worse, since they had to reset development twice or three times and there was a growing ecosystem of third party apps that got tossed around.
That's not trying. Microsoft doesn't try, they make very brief attempts and then give up just as soon as people start paying attention to them.
Not so fast. Edge was more "performant" but Google, specifically YouTube, screwed them.
Microsoft has seen this before from the other side, namely "Windows isn't done until Lotus won't run".
It's not about the quality of chromium at all, only ubiquity.
Web developers are cheap, its easy to port website's code and slap UI on it. That is the _main_ point.
The manager for whom electron is an option is least bothered by chrome being technically solid foundation. His motive is using cheap webshits and ticking a box.
Doesn't help other cross platform toolkits are either outdated, or immature, or in a weird position like Qt.
Our industry always optimized for some sort of local maxima. From a purely engineering perspective, scripting languages, or hacky UNIX/C glue, or weak typing, would not have made sense at all. But they sticked, because they fulfilled immediate commercial needs.
I don't know if this phenomenon is prevalent in other disciplines of engineering or there is a common name for it.
Bingo.
I don't understand why people keep failing to learn this lesson.
Java became popular because Sun drove it to become default installed on lots of enterprise computers. Python later became popular because if you had a standalone computer you had "batteries included" so you had the same stuff always installed.
And what people keep forgetting is that Electron is the low friction way of supporting Linux and macOS--whom most programmers would mostly like to ignore. If you write your app in Electron, you write on Windows, claim you support Linux and macOS and then ignore them.
I started off as a desktop publisher, moved up to graphic designer in the creative hub of my country, doing 3d design and video editing, from there I moved to animation and then to user interface design. throwing around 'webshit' is elitist at best and derogatory at worst. As if lack mental ability to do your job? Can you do mine?
You dont see any of us throwing around 'backend-bellend' when talking about fellow programmers.
respect the field, we are all in it.
We don't call it 'webshit' because the people are shit, we call it that because the product is shit. A pile of garbage abstractions built on other garbage abstractions all ultimately trying to make a document viewer into an application platform.
Everybody who can solve their task using a web browser will do so. If they can't, then they will switch to Electron grudgingly. And only if that doesn't work will they do something else.
OP, Me and many others here probably wouldn't mind an immediate mode GUI for an app on their computer which consumes very less memory as we know what electron does, But an average consumer couldn't care less about what electron is as long as the software does what it's supposed to do.
Then again it didn't start with electron, Java GUI applications would make 32GB memory machine crawl like 4GB anyways. Just run couple of IntelliJ sessions for few days and Linux would suddenly kill Java, IntelliJ, XServer and thereby GNOME shell with it for good measure.
Anyway heres some other choices might be viable these days: - Flutter desktop https://flutter.dev/multi-platform/desktop - Jetbrains Compose https://www.jetbrains.com/lp/compose-mpp/
IMO immediate mode guis should be option as well, like imgui, egui. (But afaik you basically throw accessibility out of the window)
[0]https://github.com/orgs/canonical/repositories?q=&type=all&l...
It bothered me so little that overall Flutter seemed way simpler to me than the web-tech stack because I had also very little experience with web apps.
I think any current experienced software developer can easily switch between 3 or 4 popular languages, and pick up Dart quickly too since it's not that different from everything else out there. Dart is not Brainfuck or Lisp.
[0]https://github.com/skyjake/lagrange
I don't use Linux, but given that Edge also supports this, I suspect that you can do this with Chromium.
I'm not on my computer, but the steps are to hit the hamburger menu, select create shortcut, and then select the checkbox. The words vary, but it's usually something like "run in separate window" or "run as application."
However, the are some apps that could do this, but have hidden some of their features in the Election version. E.g. it's frustrating that Slack can't have multiple groups in a single browser tab.
Because it's not as easy as it seems to create a proper cross-platform framework. And even if there was an alternative, these days you often need rich text, images, videos, etc. all of which are essentially HTML pages. So you'd end up adding a webview anyway, which is getting quite close to being Electron.
And I think that's the key - why create an "alternative" to Electron if you end up bundling webviews, ffmpeg, libpng and so on. It might be a bit smaller in size than Electron but not enough that it matters.
[1] https://github.com/c-smile/sciter-js-sdk
[2] https://bellard.org/quickjs/
[3] https://news.ycombinator.com/item?id=24797423
FTFY :)
What would you say is the pros and cons of Sciter?
Is it so lightweight as it claims?
Cons: Not as much documentation and help online as you might be used to from larger projects, but the documentation and samples are good enough if you're willing to grep and dig a little. It doesn't have the same parity as exiting browsers, so some existing web frameworks (like bootstrap) won't work (at least I couldn't get it to work). No debugger that can step through JS that I can find. But it does have "inspector.exe" which is like a simple Developer Tools from browsers to see the HTML with an active JS interpreter.
In the meantime, no one will bother explore other options, because it just works, even if it's a resource hog.
Yes. What other rendering engine are you going to use? If your answer is anything but a web browser rendering engine, then consider that any serious UI toolkit in 2022 is certainly going to need a WebView UI component: so if you want the WebView UI component to be consistent across platforms (you want this), then you will have to bundle a web rendering engine anyway. In that case, why not just use the web rendering engine as your main rendering engine?
There’s nothing wrong with Electron as a concept. The issue is with either: blink being under optimized for this use case, or bad Electron apps.
I'm mainly avoiding it because I want to make an app I can use (after all, I'm primarily making this for myself), and not just have a desktop app for... someone. My laptop only has 4GB of RAM, so Electron is off the cards for what I need.
So yeah, I still greatly prefer desktop applications to use native UI's and prefer to avoid browser applications where I can. But its becoming increasingly hard.
Of course, I, too, am building browser things, since that's what the industry seems to demand, so I'm not really helping the situation. I do keep meaning to learn Flutter though.
Same with me, but s/Slack/Microsoft Teams. I personally find it absolutely horrendous to use and wouldn't recommend it.
> Of course, I, too, am building browser things
Same. That's what I'm primarily familiar with, especially React. I hope some day we have something like React Native for desktop, where it integrates with the native widgets of the platform (Qt, perhaps?) and you just integrate them with your app through components... like React Native on mobile. It's such a shame this space isn't being properly explored yet.
https://www.mediamarkt.nl/nl/category/_windows-laptops-64106...
If this is the route software development is intended to take where every app is going to consume +4GB RAM good luck running multiple apps at the same time or running it on a smaller form factor.
It is truly bizarre that we are moving away from the desktop PC to smaller form factor but at the same time pushing technology that requires a desktop PC.
But unfortunately it comes with occasional bugs that are impossible to fix for app developers, so if you want complete control you can't use it
the native window environment?
> any serious UI toolkit in 2022 is certainly going to need a WebView UI component
citation needed. why do slack and discord - communication applications - need a web view component?
> In that case, why not just use the web rendering engine as your main rendering engine?
because, aside from the frankly obscene memory usage, it adds so much to the binary (mIRC used to fit on a floppy), it’s slow, is bad for battery usage, it doesn’t look in line with native apps, and it’s a huge attack vector.
I'm confused by this phrase. Wouldn't it have a 'huge attack vector space' ? I never really understood that phrase.
I'd rather build an app that doesn't require me to start with the question "which OS and window environment are you using?" followed by "sorry, we couldn't afford to build for that".
The idea that app developers have resources, skills and manpower to build ~3-7 UIs using ~2-3 different stacks – for exactly the same app – is imo more preposterous imo than assuming most users have enough ram to run a chrome+node instance.
The failure of standardizing UI has led to this. Electron is a stop-gap, a good one. As a Linux user, I am very happy that Electron exists, otherwise I would have far fewer apps.
Yes, Electron hogs resources. I am personally using Tauri, which has a much lower footprint. Importantly, I can write my app once.
i can’t help but feel your catastrophising a bit here. in any case, you have options that would greatly ease pains of this sort, wx, QT, SDL, etc. there are many. the point is that the problem with electron isn’t UI abstraction in general, just this particular implementation of it.
> [it’s safer to assume] most users have enough ram to run a chrome+node instance.
so in an effort to avoid saying that you “couldn’t afford some feature”, you’re presuming that users can afford the resources for another multi-gigabyte ram hog, which is most likely, for all intents and purposes, a pretty wrapper around JSON getters and setters?
> The failure of standardizing UI has led to this. Electron is a stop-gap, a good one. As a Linux user, I am very happy that Electron exists, otherwise I would have far fewer apps.
strong disagree here. i’d bet that electron and it’s ecosystem exists strictly only because of the abundance of engineers proficient in javascript. electron absolutely did not standardise UI.
sorry if that’s come across as inflammatory, it’s not intentional. i guess i get a bit irrationally upset when i see i can trigger a full page refresh of what should be a native application when i hit CTRL+shift+R.
Bingo. We have a glut of developers who only really know web tech, and when they decide they want to do something for the desktop they just go with what they know instead of learning something different. The argument about portability that people make in support of Electron-based stuff doesn't hold up when you see that there exist cross-platform tools for other languages. At the end of the day, the tech world is crawling with JS developers who appear to be unmotivated to learn something other than JS (or one of its transpiled cousins).
Shouldn't the burden of proof be reversed? If the stack works, why relearn in a different stack? The HN crowd loves to shit on web developers for not being good enough even at their own domain, yet at the same time encourage them to learn new tech. Proficiency takes time.
As for the environment itself, web has the best inspect/debugging experience by far, an extremely capable and flexible layout engine and accessibility built in. It's also not controlled by a company, and has ubiquitous platform support.
Obviously there's a network effect, which to a large extent led to this situation. But it also makes sense to learn today. If I was advising a junior it'd be criminally myopic to suggest learning Qt instead of web.
No worries at all. If everyone shared my opinions I'd go somewhere else (or question my sanity). Also, I'm triggered by unnecessary bloat as well.
> electron absolutely did not standardise UI.
Of course not!
> you have options that would greatly ease pains of this sort, wx, QT, SDL, etc
Yes, but they really need to work on web too, if you have a web app that shares code with the native one. Otherwise you still have two UI stacks. I was seriously considering flutter, but dart is a small ecosystem and most importantly if Google pulls their support it will almost certainly die.
Web tech isn't perfect, but it's very mature and standardized. Sure, you can bloat your app/page, but if you are just moderately responsible things are very snappy. Today, you don't even have to use JS with wasm. Tauri allows me to use web tech with much lighter weight OS webviews and no Node.
> you’re presuming that users can afford the resources for another multi-gigabyte ram hog
If your crud like app is anywhere near 1GB in ram, there are other issues. Electron adds maybe 200Mb overhead, the rest is the web app itself. App bloat is a separate issue.
This means you’ll be limited to the intersection of features of each platform native rendering engine.
On the other hand you get the union of all bugs and performance issues over each native rendering engine on each platform.
Text will be a particular nightmare, what browsers do in terms of pixel consistent yet native-feeling text rendering and input is a miracle.
> citation needed. why do slack and discord - communication applications - need a web view component?
Perhaps those apps specifically don’t use it, but it is a standard component and all modern UI toolkits are expected to have one because many apps do need this functionality.
> On the other hand [...]
we already live in this world. electron utilises the same APIs you would use. it doesn’t have a back way around these, and is subject to the same bugs and issues from the windowing system would be.
it might be tempting to suggest here that electron devs can mitigate issues themselves and remove the need for that work on your part, but now you need to update your app: shared libraries aren’t exactly in fashion right now, so every electron based app needs updated.
that in itself has a bunch of issues/consequences. if nothing else, it’s incredibly wasteful.
YouTube/SoundCloud/Spotify/etc embeds would need a webview component if Discord was a native desktop app.
well, fine, if that’s what’s required. all of the platforms have webview components, i believe.
There is nothing wrong with Communism as a concept.
Nack in the real world, open Whatsapp desktop and scroll though any chat dense with images, it takes me over 40 minutes to acroll back 1 year on a 12-core ryzen.
On Telegram Desktop, native client, this takes 30 seconds.
If you think this spitefull disregard of end users is justified, you live in cloud coocoo land
https://github.com/tauri-apps/tauri/releases/tag/tauri-v1.0....
Electron hasn't been too bad, I've been able to construct a quick prototype which will prove if people are interested in what it does. I'd ultimately like to build a native app though.
[1] https://github.com/Rodeoclash/vodon-pro
Just looking at your 3 examples, I notice they all depend on Qt ... and hence the Qt UI components instead of the more familiar HTML/CSS of Electron.
So the code ends up looking like:
So the idea of programmers having to learn a bunch of unfamiliar QXxx() like QLabel() etc -- will be a tough sell to gain mindshare. Yes, it's Javascript instead of C++ but the QXxx() will still create a lot of friction for adoption. Also, a dependency on the Qt framework may be worse than Chromium for various strategy/technical/license reasons.>Is "just stick Chromium into all your apps" seriously the best we can do as an industry? It's resource-inefficient to high heaven,
The complaints about "resource-inefficient" attract a lot of agreement but also ignore the productivity of the developers that get to leverage their existing knowledge of Chromium-based components.
If whatever alternative to Electron has SuperiorResourceEfficientTechnology also comes with unacceptable extra friction (aka learning curve) for adoption, it will then also lose to Electron.
Even with React wrapper, consider the differences and additional learning curve:
Example from https://react.nodegui.org/docs/guides/styling :
Compare with example from https://reactjs.org/docs/hello-world.html : Maybe the Qt-based Nodegui even with the more accessible React syntax -- is still too much friction for wide adoption. Yes, everybody wants lower cpu & ram usage but that goal always competes in the marketplace of ideas with DX Developers' Experience. The DX of leveraging existing knowledge is a bigger priority to many devs. Does replacing QXxxx() with <Unfamiliar></Unfamiliar> really change the equation to adopt the Qt alternatives to Electron?I wasn't trying to compare noisy lines-of-code so your simplification still doesn't change the underlying issue: unfamiliarity and not being able to leverage existing knowledge/libraries in the Electron/Chromium landscape.
In this perspective, the "<Window><Text>" is already "worse" to many devs even if you reduce the source code line count to be the same.
In an ideal world, developers wish for this (unrealistic) technology:
- No need to change any code or learn any new knowledge and just effortlessly recompile with NewTool and then the executable magically runs 3x faster with 3x less memory and cpu usage.
But such tools don't exist so we end up with the following tradeoff and reality of prioritizing costs:
- You can make your executable use X less resources and be more efficient -- if you expend this extra mental cost of Y
And that "Y" cost ends up being extra friction that many developers don't want to do. (E.g. use React-Nodegui-Qt instead of Electron.)
So the answer to "Why aren't there any real alternatives to Electron?" ... ends up being: "There _are_ alternatives to Electron but developers don't want to pay the _costs_ of switching."
I disagree, because most of my react code is already components rather than raw HTML tags. I'm already using component libraries that provide widgets and such. I'm already using component libraries that are applying styles. I only use raw HTML tags when I'm building such a component from scratch.
My point is that when writing a React UI, developers are already used to using custom components and used to learning to use them. Just because the components are modeled after Qt's widgets instead of Material UI, BlueprintJS, React Bootstrap or what have you, doesn't really change much. They all already have their own idioms and API's and learning them isn't hard.
> In an ideal world, developers wish for this (unrealistic) technology:
Sure. In an ideal world, such a thing would exist and life would be awesome. Sadly, we don't live in that world. Java tried it and failed. I'm not saying that the current state couldn't be improved, because of course it can, I'm just saying that I don't believe the Qt-based React wrappers are such a big deal as you seem to be suggesting.
> if you expend this extra mental cost of Y
Leaving aside the React wrappers, using alternative UI technology is only extra mental cost because you're unfamiliar with it. I found switching to web to have extra mental cost after doing native development years ago too. You get over it quickly enough, as you learn the new tools. Of course I would love if there was a single tool that worked for all cases, just like you.
> So the answer to "Why aren't there any real alternatives to Electron?" ... ends up being: "There _are_ alternatives to Electron but developers don't want to pay the _costs_ of switching."
Yes, absolutely agree.
If the above is true, your disagreement and all the supporting arguments (custom components) for React-Qt you listed can be summarized to "zero learning effort compared to Electron". That would mean that using Qt-based alternatives to Electron would really be free of switching costs.
But that's not happening out there in the marketplace of ideas so there must be an extra hidden cost somewhere in React-Qt that you're (inadvertently) underselling. Some possibilities:
- Even if the higher-level Electron custom components are <unfamiliar> tags that must be learned, there is value in web devs being able to see (copy/modify) the underlying HTML rather than Qt components. HTML components has more survival characteristics than Qt components. This bubbles to higher levels of custom components.
- wider ecosystem of libraries, hooks, code samples to copy-paste from web, etc that grow from HTML survival characteristics.
- Electron without React/Vue/Angular (raw HTML) is more familiar to web devs than Qt QXxx()
- Chromium runtime has extra capabilities (e.g. play media formats) that's not available in Qt runtime
So proposing that learning React-Qt is "different-but-irrelevant-because-it-is-actually-equal-effort" to Electron/Chromium is missing something about the switching costs. Otherwise, devs could just effortlessly switch to React-Qt and get resource-efficient executables and positive vibes from fellow devs for free.
And that is the problem. We're living in a world where it's considered acceptable to make millions of users waste quadrillions of CPU cycles and petabytes of RAM every day (pennies, really) so that a relatively small number of developers can be more productive.
When you don't have many users, the time and money you save by being more productive might still outweigh the combined cost to the users, so your app is still a net benefit to the world. At a certain point, though, if you're lucky enough, you will begin to push a heck of a lot more externalities onto your users than you're saving internally. (I'm looking at you, Slack.)
Are we at the point where all developers, or all GUI developers, are expected to be familiar with HTML/CSS/JS/DOM concepts?
The QT stuff is familiar to me (from python mostly), but I have only very barebones knowledge of HTML/JS and almost none of the DOM and CSS.
Unfortunately, yes, and we've been there for a while.
>The QT stuff is familiar to me (from python mostly), but I have only very barebones knowledge of HTML/JS and almost none of the DOM and CSS.
Feel free to join the rest of us dinosaurs out on the patio to watch the world burn.
For the web developers who want to re-use their existing frontend skills of Javascript+HTML+CSS to create cross-platform desktop executables ... instead of learning a different GUI toolkit such as C++ QT, or C# Winforms WPF, or Java SwingGUI, Pascal Delphi, etc.
The op's links of Electron alternatives based on Qt do offer re-use of Javascript skills but I guess that's not enough of a compelling value proposition to gain mindshare.
Electron let's me provide feature parity for three platforms on a nights and weekends time budget. Plus the whole Vue ecosystem is available to me.
Both don’t really solve the browser engine thing, but at least Neutralino is much smaller in terms of executable size.
I like the idea you can use any language you want for the backend/system level stuff, though for me that just means more typescript :)
The worst part is that the people who fucked that up refuse to acknowledge they were wrong. No amount of evidence is enough to penetrate their big dumb egos.
So it took 24 years to get a cross platform rendering engine that was feature rich enough for great desktop apps. Even if we take these learnings, how long till we get a new framework good enough?
It seems like Chrome OS really had the right idea. Can't we have some cross platform app format that's just a ZIP file full of HTML, with some APIs that go beyond normal web features?
The good parts
Low barrier to entry - if you know javascript you are good to good. No need to learn C++ or Java for building a desktop app.
Truly cross platform - any platforms that chromium supports, electron supports
A very active ecosystem - The community around electron is amazing. I am a big fan of electron.build, things like code signing / auto updates etc are provided out of the box
The not so good parts
IPC hell
Electron has a main process and renderer process and they communicate via events. I found myself swimming in the event soup very often.
Easy to make mistakes
This is more for a note for me or any beginner, but it is easy to write compute heavy code in the renderer and make the ui unresponsive or sluggish. There are many other things like this where it is easy to do things the wrong way.
Security
Electron still has a capable browser which can open any webpage. Mix that with native access and you have a remote code execution vulnerability on your hands.
Bloated binaries
Even the simplest of the electron binaries are large, thats just the nature of electron.
Shameless plug
The app that I am working on is https://loadjitsu.com, I rewrote it using golang, couldnt be happier.
Ironically, this might also be what you need to write a fast non web based client to your app. By keeping the UI renderer is in a separate process, it could be written in any language or technology at all and the "main" app would be none the wiser.
What did you move to? You mention Go, but which GUI framework? Fyne, Gio UI, bindings for GTK or Qt?
What language would you write the actual app logic in?