Get the top HN stories in your inbox every day.
forgotmyoldacc
dmitryminkovsky
I guess but compatibility issues on the web, while they existe, are pretty discrete these days. Browser monoculture is exceedingly worse, both practically and from a business perspective, in my opinion.
cpuguy83
As someone who uses Safari on Mac, I can say that compatibility issues are a big deal. Granted many of the issues are simply from sites checking for Chrome and telling everything else to f--- off. I've even seen a site fail to run on (chromium) Edge because it really wanted Chrome. However, real compatibility issues are a thing as well.
That said, I hate electron. I hate that I have to run 4-5 instances of chrome on my machine all day long for various different apps instead of the developer checking that their stuff works across the 3 main rendering engines.
Hasu
You are correct that Safari has major compatibility issues, but incorrect that the problem is simply that developers target Chrome (it happens sometimes, sure). Most things that work in Chrome also work in Firefox, but WebKit is ~10 years behind both Firefox and Chrome because Apple hasn't invested in keeping up to date with web APIs where their competitors have. Hell, even Edge (before it adopted Chromium) was more compatible than Safari.
Personally, I view Safari in 2022 the same way I viewed IE in 2012 - as a backwards browser holding back web development because the company developing it just doesn't care about the web. The compatibility issues aren't as bad, but I have to care about Safari because iOS still won't let any browser use anything other than WebKit, where there was a point where saying "Anyone choosing to use IE11 deserves a bad experience" made a certain amount of sense. No one gets a choice on their iPhone, so Apple makes things harder for web developers, probably because they want them all to be iOS app developers instead.
jchw
To be fair, I hate Safari with a passion. It took until iOS 15 for support for WebAssembly.initiateStreaming and there’s still no support for WebM or Opus on iPhones. Curiously, on platforms where Apple doesn’t mandate a browser engine, Safari is magically able to support codecs that aren’t patent-encumbered…
hlbjhblbljib
Nobody tests on a Mac. If Apple wanted the platform to be supported they could make it much cheaper to test on, but instead they've made developer hostile moves for the last ten years.
stcredzero
Granted many of the issues are simply from sites checking for Chrome and telling everything else to f--- off.
The world has circled back to the bad practices around IE 6! History doesn't repeat, but it sure does rhyme!
fabiospampinato
I don't know about that, one data point: an ES2018 feature, regex lookarounds, is still not implemented in Safari. And the JS engine is the thing that's the most compatible across browsers, nowhere near the level of incompatibility of the rendering engine for example.
nine_k
Ignore stuff that was added to HTML, CSS, and JS for last 4-5 years. You'll still have a pretty solid? GUI platform, likely more capable and accessible than Qt or GTK or AWT.
With the usual compiler / transpiler stack, you'll have a nice, fast-to-market, non-esoteric development environment. All without the need to ship 100MB binaries.
dmitryminkovsky
For language issues I assume using Babel, which in my opinion is not a big deal if you’re already making an app.
Render-wise, browsers are pretty uniform these days. I experience very few problems in this regard, and my app Pony runs out of the same web codebase on all platforms (iOS, Android, web). The worst offender is Safari, but it’s not that bad. The potential gains from something like Tauri (and I plan to try Tauri for Pony desktop) far exceed the compatibility concerns for me (which I’ve already had to address due to web).
kjleitz
Safari not supporting lookbehinds is a bigger PitA than I ever imagined it would be.
duped
Couldn't you just package your favorite regex library and expose it through a JS function binding in your app?
wolframhempel
As a guy who started web development when IE6 was the dominant platform I cannot cherish "browser monoculture" enough.
.clearfix
runarberg
And now we have display of "flow-root" instead of clearfix.
However the only reason I ever used the clearfix hack was when using float to do layout. I haven’t done that for ages (i.e. since CSS grew to include flexbox and grid). And I only ever use float to—well—float images inside text where the inside display is always inline. So I haven’t ever seen a need for display flow-root in the wild... Although I’m sure it exists.
baxuz
It's much bigger than you think.
If I'm building an electron app, it's because I need native code running in nodejs/V8 as native addons, often in the render process, or I'm using bleeding edge APIs not available on Safari.
This type of framework is simply not an option.
kyriakos
Safari is missing features and has its own quirks so I wouldn't say that.
krapp
"cross-platform compatibility" isn't guaranteed on the web either, yet somehow "cross-platform compatible" websites exist.
It isn't a problem that's so difficult it requires wrapping a 60Mb runtime around every individual app instance.
wokwokwok
I mean… fair, but is the 60MB runtime the issue?
I really don’t care if my hello world UI is 60MB to download, I care that it consumes 1 GB of my precious ram to run.
How is running js with a rust backend any better than running js with a C++ backend?
I guess your “backend” is rust here, which is nice (because I <3 rust), but tell me this won’t sit there guzzling all the memory it can get it’s hands on for the UI?
Ie. really, do you get meaningful benefits from using this over say, literally just using https://github.com/webview/webview?
rebolek
> I really don’t care if my hello world UI is 60MB to download
lot of people cares, they may have a slow connection, must pay per MB and so on.
There is no reason why hello world UI should be 60MB.
hkalbasi
Per https://github.com/Fournux/tauri-vs-electron it uses just 20 MB of ram on linux.
Why? I guess because webkit-gtk is less ram hungry than blink.
dotancohen
> I really don’t care if my hello world UI is 60MB to download,
If you're writing Hello World for fun, then sure. But _I_ won't be using any of your software if it's that bloated. I'm not going to even complain to you about my internet connection or hard drive space or personal preferences. If you are not going to respect my resources as a dev, I will not use your software. Just like I won't ride with a cabbie who curses and cuts off other drivers.WolfOliver
To download the zipped version of https://www.monsterwriter.app/ it needs 100MB. If I build an universal file (Intel and M1) it doubles in size.
I assume this to be a conversion killer. If you have to wait 10 min do download you loose interest in trying it out.
jraph
One can hope that the code of the engine will be shared across apps in memory, thanks to shared libraries, and that the engine itself will use shared things too, by virtue of being distributed with the OS.
... if you happen to run other browsers and apps using this WebKit / libwebkitgtk / webview.
and that embedded apps won't be obese frontend code with bazillion npm dependencies and a heavy, all too widespread framework, of course.
Hopefully, developers turning to Tauri will have some sensibility to lightness.
dmingod666
It's got better memory stats than electron on the tests I saw..
kitsunesoba
I’ve always felt that engine inconsistencies in electron-alikes are a bit overblown, particularly now with the old IE-based webview out of the picture (modern Windows uses a Blink-based webview). They’re all capable of the basics, and the greatest inconsistencies will be found in newer features. Stick to a slightly older well supported set of features and you’ll be fine.
There are some significant differences between engines when it comes to things like local file access, but that’s what the native component of electron/tauri/etc is there for.
FooBarWidget
I'm not sure why downvoting is needed. What's said is true: on the web we already have to deal with different browsers and versions. It should be a fact of life for web developers. And things today are still infinitely better than back in the IE 6 days: many modern features work on all major targets. Why do people insist so much on engine consistency for "desktop web apps"?
usrusr
Yeah, and large fraction of the dev appeal of Electron is that a concern that has haunted web development for a quarter of a century is completely out of the picture when you do Electron. You're not even concerned with possible differences between past, present and future versions of the engine because your code runs with exactly the version you bundled.
Sure, if your app is just a faux-native variant of something that is developed for the browser anyways nothing is lost, but if it's an offline first application that just happens to use web tech for UI the difference is huge.
schwartzworld
Most cross compatibility issues have been resolved in browsers. Firefox and Chrome are pretty much at parity, Edge is chrome and Safari is the exception.
Web views are less standardized though and require more finesse.
dmitriid
> Firefox and Chrome are pretty much at parity, Edge is chrome and Safari is the exception.
Firefox and Safari are very much at parity. Chrome ships ~40-70 new "standard" APIs every month or so: https://web-confluence.appspot.com/#!/confluence
tekknik
In my experience it’s Chrome that does weird things. I write for Safari and it works great in FF. Chrome and Edge will require some tweaking of CSS to make it look correct.
fragmede
Chrome is the new IE6, and guarantees cross platform compatibility everywhere it uses its own renderer though. (Basically !iOS.) It's a strong reason for choosing to Electron for your "native" app.
pjmlp
Nice IE reference, helping Google to spread ChromeOS is exactly one reason not to package Electron everywhere, besides the bloat to have multiple copies.
awestroke
Everyone is basically using Chrome or Safari nowadays - so WebKit. Very little incompatibilities to consider compared to writing something that works on different WebView implementations
Semaphor
Luckily, that is not the case. In Germany, FF still has 20% on Desktop and 10% total (and I wonder if those numbers are maybe too low, as FF blocks those trackers by default).
ben-schaaf
WebKit and Blink have many significant differences, especially when it comes to supporting newer features. In terms of incompatibilities they're about as different as Gecko is from Blink, if not more so.
sanxiyn
Sorry, I am using Firefox.
roblabla
WebKit, WebKitGTK and WebView2 are all webkit-based too currently. WebView2 was always chromium-based afaict, I think the old trident-based edge had a separate control.
Also, on the web, firefox still exists.
dmingod666
Saw a comparison, Electron app size of 138MB Vs Tauri in single digit MB is a big difference though.
favorited
This is a feature. It means every process doesn't have its own copy of Chrome.
It might mean more testing for developers, but it's a benefit for users.
pjmlp
Yes, the lazy devs path, helping Google to spread Chrome everywhere.
fabiospampinato
Arguably that's like observing that the same feature works differently in 2+ browsers and blaming web devs for it. It's the job of the browser people to make correct, or at least consistent, platforms.
While part of being a web dev unfortunately is also dealing with this you can't necessarily blame web devs when Safari breaks IndexedDB for the nth time, or when after using ES2018 features like regex lookarounds you discover that Safari still hasn't implemented them (which year are we in now, 2022?).
You may also discover that mobile and desktop browsers work differently in some aspects, not everybody even has the resources to test every single thing in 3+ desktop browsers (which may require at least 1 VM already if you are not developing on macOS, which I think might even be illegal to run in a non-mac hardware, bizarrely) and 3+ mobile browsers (which may require at least one physical device or a macOS VM for the iPhone, and another physical device or another VM for Android, and all these VMs aren't exactly lightweight).
Besides an Electron app doesn't necessarily have to run anywhere else, there's no point in checking compatibility with Gecko when your app never has to run there.
pjmlp
Arguably that's like observing that the same feature works differently in 2+ POSIX OSes and blaming devs for it. It's the job of the OS people to make correct, or at least consistent, platforms.
YPPH
Does the Chrome engine, embedded within Electron, contain any Chrome features which one could legitimately call into question (such as sync)?
If not, what's wrong with it "spread[ing]" everywhere?
It's hardly lazy dev work. It's a pragmatic approach to developing cross platform apps quickly. Apps that, it might be added, don't have a horrendous UI, which is common with other frameworks.
niyaven
> If not, what's wrong with it "spread[ing]" everywhere?
Because then it's a monopoly. I'm taking shortcuts but having a single browser engine controlled by a single company means that you rely on that company to define what is tomorrow's web like.
gr__or
I'd argue Babel-ing and polyfill-ing the webcompat delta is wiser than shipping chromium
silon42
It would be better to use Rust+Servo (no JS, or at least optional) IMO
simion314
>(no JS, or at least optional) IMO reply
At this point why not focus on some actual GUI toolokit, like write a Qt clone in Rust, for real world apps we don't need all the CSS and HTML crap, you need simple layout, GUI components and an option WebView you can embed in the app if needed. Probably there is no commercial interest to pay professional developers with real experience to implement this.
MathCodeLove
HTML and CSS, while not perfect, are still the best tools I've found to create a pleasant UI. Other libraries like Qt do work, but it's more difficult to get things looking exactly how you want them to look.
sanxiyn
People are doing that too. https://sixtyfps.io/ is basically a Qt clone in Rust, actually developed by previous Qt developers.
austincheney
I have written a full OS like GUI in JS proving that it can be tiny and memory efficient. The GUI part of the application is about 2k loc across two JS files plus CSS and includes full file system display and navigation. It’s all vanilla JS and static DOM methods so it’s as fast and memory efficient as the browser allows.
It’s amazing how fast the browser can be for this (and tiny) when you aren’t using querySelectors, vDOM, or event listeners.
seumars
I believe the interest is there, it's just not as easy as it seems: https://raphlinus.github.io/rust/druid/2020/09/28/rust-2021....
jackosdev
egui is a really fantastic Rust GUI toolkit, best I've used in any language
duped
Because layout, rendering, and accessibility are not easy problems to solve and already handled by browser engines that come with your OS.
It's more work to reinvent those wheels than bind to them.
Blahah
Tauri allows you to build apps that are pure rust - the js is optional and has multiple configurable integration models called 'patterns' that allow defining and constraining the engines includsd, the interfaces between them, and the tradeoff between binary size and distribution simplicity/robustness.
brnt
> WebKitGTK
Is there something like WebkitQt? Guess it would use WebEngine.
fabianhjr
Webkit not WebEngine. ( https://webkitgtk.org/ )
munro
I used this a bit, it was really great. Writing a Rust backend & exposing it to TypeScript was really slick!
There was one issue I ran into that made me think about jumping to Electron mid project, but I can't remember what it was now, but I think it was something like making my app bleed the entire MacOS window while still being moveable.
The other downside is you're going to be tempted to go down the rabbit hole and do everything in Rust. [1]
rileyphone
Thanks, I came to this thread to find personal anecdotes about using it but of course it's just hacker news hackernewsing about electron and what have you. I think I'm going to start my project with Tauri+Svelte and see how that feels.
outworlder
> The other downside is you're going to be tempted to go down the rabbit hole and do everything in Rust.
Downside? :)
giorgioz
At https://www.waiterio.com we use plain webviews for Android, iOS and macOS without any framework and Electron for Windows and Linux. The problem with frameworks is that once a year Apple make a change to their signature and it can break the framework for several weeks/months before a fix/hack around is found. By using native webviews you can quickly implement the change needed and get back online in days.
dangoor
Projects like Tauri use libraries like Wry[1], though. Getting Wry fixed to use the new API shouldn't be any more difficult than the work you need to do, right? And that work is then shared by everyone using the project.
[1]: https://github.com/tauri-apps/wry
Edit to correct that Tauri uses Wry and not Webview.
spiffytech
Wry is for desktop, but the grandparent is also targeting mobile.
TheHippo
I don't know how the website was translated, but the German translations are terrible.
WolfOliver
would this work for Windows and Linux too?
giorgioz
Vanilla webviews is definitely possible on Windows with Webview2 https://docs.microsoft.com/en-us/microsoft-edge/webview2/ The problem though was compatibility since that webview might be based on old versions of Edge which used to be a much more outdated browser than Safari/Chrome. So far in 5 years of using Electron Windows never broke Electron except on a minor instance. Our Windows Electron app doesn't work on Windows 10 S. The problem might have became fixable by now but Windows S had so little marketshare that we never found time to fix that issue.
WolfOliver
I mean MacOS, not Windows
giorgioz
yes we already had a macOS published on the App Store for 2 years written as a thin Swift app with WKWebView: https://apps.apple.com/us/app/waiterio-restaurant-pos-system...
https://developer.apple.com/documentation/webkit/wkwebview
The app store reviewers will allow apps with only webview only if you are offering some feature that would not be possible to implement in the browser alone.
Simplicitas
Rust and Electron haters can do all the hating within this one post here.
sanjayio
What a great idea. I don’t understand the hate for either at all. They’re tools for a job.
SavantIdiot
Drake turning away: ElectronJS 0.06GB app
Drake approving: Any modern game requiring 100GB of content
AnIdiotOnTheNet
Modern games have a shit-ton of assets in high quality. That takes up significant space no matter how you deal with it.
Electron generally isn't doing anything more interesting than what we did on Win98 with 8MB of ram for the entire system.
dylan604
The meme is bad, but seeing it as text is even worse.
chana_masala
I like it a lot this way actually, haha.
mysterydip
I'd love to see some electron apps that use 60MB of RAM. Can you share some examples?
steveklabnik
Right now, the various Electron apps I have running:
1Password, 155mb
Discord, 441mb
Element: 38.7mb
Signal: 91mb
Slack: 46.2mb
A few higher but a couple that are lower...
chana_masala
As a meta reply - it's quite funny to see this meme in textual form.
jokoon
I have a hard time understanding why platforms like electron are so popular.
The predictions from Gary Bernhardt seem to really be true, in the future everything will be javascript.
I wonder if somebody actually tried to make an OS that only has a browser, that's what Chrome OS actually is, after all.
yboris
I chose Electron for the app I was building because it would make sure the app I create (1 code base with Angular) would perform exactly the same way on Mac, Windows, and Linux. It required virtually no learning of anything new (just look up some Electron API like "minimize window") and I was done.
https://videohubapp.com/ & https://github.com/whyboris/Video-Hub-App
As a single developer, I was able to get an app out in a few months and have been improving it for 4 years now. I love it (enough to create a Renamer app too: https://yboris.dev/renamer/ ).
lijogdfljk
> I have a hard time understanding why platforms like electron are so popular.
For an example. I'm writing a FOSS app mainly for myself, but i am publishing it for everyone of course. I want to support Browsers, but also "Apps" in OSs. I'm on Linux, MacOS, Windows and iOS every day.
I do not, by a large margin, have the time to write my application in 3 or 4 different native UI toolkits. Furthermore, my application has a lot of text editing and rendering functionality, one i'd have to then reinvent in various UI toolkits, unless i used something that crossed all OSs above perfectly. Finally, my app has WASM plugins, similar to Obsidian.md, to allow the user to easily extend the application.
All together i will not, by a large margin, use anything Native. I barely have enough time _(don't, honestly lol)_ to write the app once - let alone supporting all the above platforms.
I'm targeting the web.
As an aside, i'm writing this in 100% Rust lol. No JS, because i prefer Rust.
sbarre
Aside from the improvements to project timelines, Electron and similar products are popular because they improve the developer experience, and in 2022 the developer experience is what matters the most to many software companies (yes, in many cases ahead of the customer experience).
DX directly drives engagement and retention, and good developers are hard to find (and keep!).
And like it or not, there are more and more developers entering the industry with web-only training, so we have products that reflect the stack and tooling those developers are most proficient with.
vp8989
It's not just the developer experience, in fact that is probably lower on the priority than you would think. The entire business IME struggles to reason about a product, in the details, that is logically 1 product but physically N products by virtue of all the different target platforms and codebases required.
formerly_proven
JS DX always seemed really quite bad whenever I looked. A constantly shifting landscape of frameworks and packages where nothing will stand for long before being eroded away.
yayr
let's see
- language: ES / Typescript are quite established
- CSS: also quite established
- Frameworks: there is still a lot of innovation here, but also React / Vue / Angular are quite established.
on that latter part I prefer the innovation. Let's just imagine for a while what UI would look like if we only had Swing (Java) or QT (C++)
Chris2048
> Electron and similar products are popular because they improve the developer experience
> more and more developers entering the industry with web-only training
aren't these very different things? Is Electron popular because web-skill are so common, or because the dev experience is better - I sceptical of the latter, as I find JS very dependant on framework/ecosystems for compatibility.
sbarre
Sorry if I implied those were tightly coupled. I do think they are related but more loosely than perhaps I meant, and not exclusively.
Electron improves DX for all the usually stated reasons (build once for many platforms, etc) but I do think there is a connection to the fact that a lot of developers out there are learning web tooling, and if a company wants to put out a desktop app in 2022, it's an easier (and therefore better for DX) path to use something like Electron or Tauri - where devs can use the skills they already have - than try to either upskill or hire a team that can build native apps on all your desired platforms.
worik
> in 2022 the developer experience is what matters the most to many software companies (yes, in many cases ahead of the customer experience).
Not working on iOS
gitgrump
> ... and in 2022 the developer experience is what matters the most to many software companies...
This is what happens when you keep lowering the bar, and more and more developers can do less and less.
berkes
No, this is what happens when supply and demand are way out of balance.
There simply aren't enough developers over the entire range, and certainly not enough with decades of experience, for all the work that can be done.
Renting additional servers, etc is cheap and easy compared to hiring additional developers. So we all optimize for that.
fastball
We built our product for the web. People wanted our product as a desktop app. So we wrapped it in Electron and now we have 3 desktop apps. People wanted our product as a mobile app. So we wrapped it in Capacitor and now we have two mobile apps.
There are just two of us building this product.
throw10920
What prevents you from using Qt to do almost exactly the same thing?
fastball
Our platform[1] needs to run on web/mobile, so... Qt would not allow us to do even close to the exact same thing.
[1] To help provide more context: https://supernotes.app/
iterati
2 developers. Also, "almost exactly" is a funny oxymoron.
kristiandupont
They built their product for the web.
AtlasBarfed
So efficient for you, but 1000x more resources everywhere it runs.
I wonder if someone can quantify the carbon impact of Electron just from Slack.
adwn
> So efficient for you, but 1000x more resources everywhere it runs.
And yet, to the people who do use their app on the desktop, this is obviously a preferable situation to not using the app – which would probably be the case had the developers decided against Electron.
rk06
would you rather have three teams developing one app on three platforms (windows, mac, linux) or one team developing one app for all platforms?
It makes perfect business sense to use electron. It opens paths which otherwise would be very costly and hence infeasible.
thomascgalvin
> would you rather have three teams developing one app on three platforms (windows, mac, linux) or one team developing one app for all platforms?
I would rather have one team developing a cross-platform application in a language that isn't Javascript.
pitaj
We'd love to. What do you suggest we use? Java swing? C Gtk? C++ Qt? All of those often look ugly and are harder to use.
ReleaseCandidat
> I would rather have one team developing a cross-platform application in a language that isn't Javascript.
So, use one of the many languages that compile to JS. Starting with TypeScript. Or (alphabetically) ClojureScript, Elm, PureScript, or Rescript.
purplerabbit
Given that there's no other language that works cross-platform with as little jank as JS, I don't think that distaste is adequate reason to avoid using it
egeozcan
Why do you care which language software is developed in?
Should I not use anything that uses ML if I dislike python?
worik
HTML/CSS/WASM??
Would that work?
I am not a front end kind of developer, I am a "plumber". So it is a genuine question.
berkes
While I agree that maintaining one codebase is preferable, the 'teams' part is a bit off.
No-one wants 'three teams building one product' which is why it almost always is far better to have one team with android, iOS, web and desktop mixed. Obviously if their mixed erpertises are around one codebase, that is even better.
azangru
> It makes perfect business sense to use electron.
In many cases, it should also make perfect business sense to use PWAs. I've heard Adobe has brought a significant part of the Photoshop and Illustrator functionality into their web apps.
MontagFTB
> I've heard Adobe has brought a significant part of the Photoshop and Illustrator functionality into their web apps.
This is true. We managed to wrap a very large portion of the desktop code base into a “portable” library (with some customization at the point the library hits the OS, e.g., file IO.) This library is compiled specifically for the OS it’s going to run on (iOS, Web) to give us the best performance we can muster.
The UI for each implementation is bespoke. This lets us build native interactions on the platforms we ship to, giving the end user the best look-and-feel for the platform they’re on. The flip side to this is development cost and time. In the long run, we believe it is worth it.
Rewriting Photoshop in Electron would have been infeasible and the performance hit a non-starter. The path we’ve taken has some trade offs to it, but is the right one given the legacy tech we have and what we want to do with it.
throw10920
Here are the reasons, bad as they might be:
(1) Branding. Businesses want their app to be thoroughly branded, so they'd rather have a canvas where they can invent their own buttons than use something cross-platform native like Qt.
(2) Hiring. Existing developer base trained on webtech. Qt is a C++ thing - there's a far greater hiring pool for webdevs than C++ devs.
(3) Ignorance. Some developers don't really know that Qt exists, or want to go through the trouble of learning it.
None of these reasons benefit the user - but Electron isn't chosen by those who want to benefit the user in the first place.
pornel
Right-click, Inspect Element.
Web development tools have become fantastic UI debugging tools. You can inspect live running UI and tweak it in real time without a rebuild.
CSS is very powerful, and it's relatively easy to build complex layouts with animations. People joke how it's impossible to center things, but CSS has matured beyond that (IE is dead).
int_19h
WPF had the equivalent of "inspect element" 10 years ago. You don't need HTML for that, you just need good tooling.
pornel
I must admit, I haven't been following Windows toolkits since MFC. I've only heard about WPF in the context of dead Longhorn features. Isn't it deprecated in favor of WinUI or whatever replaced Metro?
didip
It is not hard for me to understand that even though I am not a client-side engineer.
Web tech (HTML, JS & CSS) are widely understood with millions of tutorial reference. On top of that, you get a cross OS build that looks the same everywhere.
If all you are paying are just CPU and RAM, then that is a great tradeoff.
worik
The bits that face the user are an important part of, but only a part of, all the gears and wheels that make a computer programme useful
fiatjaf
When are we going to get back truly native apps?
Flutter Desktop works great, and there are a bunch of nice GUI libraries for Rust, also some new developments for the JRE.
krapp
Probably never. The web is becoming, if it hasn't already become, the universal platform for application development and distribution, and javascript the One True programming language. Every holdout will eventually and inevitably be assimilated, either transpiled into javascript or compiled into WebAssembly.
And it's partly the fault of the native programming community. It should be as easy to write a native, cross-platform application as it is to write html, css and javascript. Native developers should recognize what works about the web paradigm and adapt to it. There should be forks of these technologies specifically designed for native application development rather than documents. But that never happened, GUI development is still basically programming and it still sucks and now the train has left the station. The only relevant innovation likely to happen now will be iterating on the web-app model.
I mean, I'm looking at the layout tutorial for Flutter now[0]. It's nesting function calls and you have to update a yaml file to include an image, whereas with HTML it's a simple table or maybe grid and the img tag. This example for Rust[1] is ridiculously verbose and noisy compared to the web stack. All GUI programming is. Meanwhile I can write a fully functioning website with nothing but a text editor. No need to install a language runtime, package manager or IDE, no need to learn a company specific workflow or follow a style guide. No need to memorize a new set of quirky verbs for a CLI.
I don't even like the web-app paradigm, but I can totally understand why it won.
kaba0
With all due respect, I think the web’s layouting (or lack of) is the most complicated out of any framework I have ever used (including qt, swing, javafx, winforms, wpf). I think the great majority of web devs would have trouble recreating something like bulma (regarding layouting) even without responsiveness — I definitely would have quite a bit of trouble doing that.
So if anything, we are just accustomed to the web’s way and other (saner) approaches look stranger for some reason (even though with some insane complexity js frameworks come back and mimic the two decade old frameworks here and there)
fiatjaf
I agree with that. Doing layouts with HTML and CSS is too open, flexible, which means you have to do everything yourself from scratch every single time.
Another thing you have to do from scratch is the eye candy aspect of every webapp. I guess the web is more flexible in the sense that you can do anything you want UI-wise, but honestly, how much time and work and money is spent on making pretty webapps? How much more productive our society would be if the useful tools were just tools and not masterpieces of design?
asimpletune
Can you explain more the part about native apps being hard to make? I mean, I can open Xcode, start a new project, hit run, and there's an app ready to go, with a simulator and everything. It has API's that allow safe access to OS-level resources. It has powerful multi-threading, built-in views that I can reuse (like collections), stack based browsing is native, etc... Also, the client is not broken by default (I.e. client apps in the browser are by default spyware, at a technical level).
All the weird tooling that exists around actually getting html + js + css to work like an app is an indication to the contrary. The constantly evolving ecosystems is an indication of reaching stability, not having yet achieved it.
I will say though that targeting different platforms is an issue, which is not the same thing as your claim. Yes, targeting all platforms is hard, but I don't think any one native app ecosystem is really any harder than web.
I do think there's a lot of survivor bias from people whose job it is to build apps with web technologies.
And to your point that "it won". I don't think anyone, even lay-people, like electron-based apps. It's just what they have to use because there is an infinite amount of web developers. However, I feel that it's a bit premature to call call something that's ubiquitous that everyone hates as "winning".
Also, the most used software as a matter of time on task would probably be excel, email clients, and web browsers. All of these are built natively. So with the exception of slack, and taking a broad view of the road that lies ahead, most of the stuff that's built on electron is sort of vapor in the grand scheme of things.
I think we can actually expect to see more and more native apps, due to power consumption requirements. I stopped using Chrome years ago due to its aggressive power/memory consumption and never actually really looked back.
Any way, sorry for the unnecessarily long response, but seriously what you're saying is very hyperbolic. We are literally just at the beginning of the absolute beginning in terms of what technology is going to look like. Things will be very different in 5 years and super different in 10-20 years.
fiatjaf
I agree.
Writing native apps is very easy once you get mildly used to any framework for writing native apps.
The "web" is just another framework, a very popular one, but also one that is very bloated and hard-to-use.
shaolinspirit
from my experience the struggle with making native apps is in implementing all of the services that are in browser environment out-of-box manually. image caching, websocket handling etc.
which enables more fine tuning for the end product, where in html you can put img tag and that little thing will fetch the image for you, store it somewhere and render in accordance with some layout structure.
in mobile dev you need to do more so to say, low level stuff in comparison with browser.
fiatjaf
Has the web won on mobile? No. In fact there was a time in which Cordova-like apps were getting very popular, but react-native and then Flutter, Kotlin and Swift have ended that. Or at least that's my impression. react-native is almost like the web still though, but the fact that people are doing react-native and not Cordova must mean something.
Meanwhile, 10 years ago the only ways to do desktop native apps were the old -- very good, but old, with that old feel -- technologies like GTK and so on. Now there are these other things I cited above, and more! It's a renaissance.
Chris2048
But isn't this the danger of evaluating something via simple example?
You can make fine websites with just a text editor (although I'd argue how easy CSS is to use) but as soon as it needs to be an app you need JS code, and suddenly the difference isn't so great. Infact, I'd probably find a traditional prog-lang easier to use in that case.
I think the real advantage of JS is the robustness of its sandbox & permission system, that's what really needs reproducing.
ReleaseCandidat
> When are we going to get back truly native apps?
When the browser is the OS - or the other way around.
thejosh
It's always going to be a pain.
The best thing about electron is that it brings apps that otherwise would be locked to Windows (and probably Mac) to Linux.
flohofwoe
Here's a similar, older and slightly less hipster project for Go, C, C++ (and more languages via C-API bindings):
https://github.com/webview/webview
...I wouldn't go as far as calling a simple WebView widget wrapper an "Electron alternative" though.
dolmen
According to the About page of Tauri, the Tauri team is maintaining the Rust bindings of Webview.
Source: https://tauri.studio/en/docs/about/intro#polyglots-not-silos
Per_Bothner
For DomTerm (https://bothner.org) I've used both webview/webview and wry (on Linux only) - and both are usable. The main problem with webview is that it is semi-abandoned (last checkin was in March) and the features set is pretty minimal. Wry is actively developed and has more features. However, the wry-based executable is quite a bit bigger than the webview-based one. And of course leaning to use Rust is an issue.
Per_Bothner
Oops: For the record, DomTerm is https://domterm.org, while bothner.org is (I believe) some unrelated German family. (My personal/family website is bothner.com.)
WolfOliver
I'm using electron for https://www.monsterwriter.app/ and i'm looking for a lightweight alternative since a while.
This seems to be a good fit. I guess when you can reduce the api calls to bindings (accessing filesystem, network, etc.) cross platform compatibility should not be a problem.
WolfOliver
I would be curious if anybody onboarded an Tauri application into the Mac App Store and if it builds for M1?
twarge
It cheerfully builds and runs on M1.
jhgb
Have you tried Sciter?
WolfOliver
I do not really understand the lisence of this. In the repo it says its open source but on the website they ask for money?
c-smile
Sciter SDK (https://github.com/c-smile/sciter-js-sdk) is OpenSource/BSD
But Sciter Engine itself (https://sciter.com) is not OS - its sources are available to customers only. I tried to make it Open Source ( https://www.kickstarter.com/projects/c-smile/open-source-sci... ) but not too much interest for that.
nisegami
As I understand, stuff like this is typically called "source available" rather than "open source".
jhgb
Sciter currently isn't FLOSS, but you're free to use its dynamically loaded binary distributions.
WolfOliver
no, but looks like it natively builds for m1 :)
c-smile
That's correct.
Sciter supports ARM and M1 targets natively: Windows, MacOS and Linux.
As also H/W rendering with backends: DirectX, OpenGL, Vulkan(coming) and Metal (coming).
fabiospampinato
One very important thing I'd like to highlight: using one shared browser instance rather than N is not gonna make your apps that consume 1GB+ of memory suddenly consume much less than that, the problem for those apps is the code they run, it's not the language, it's not the platform, it's the badly written code, and Tauri doesn't change that.
parhamn
This is a great point. I think last I measured a basic electron browser/webview is about ~20-36mb which is not far from an about:blank chrome tab. The 300mb+ memory usage you see is mostly the javascript from the apps themselves.
Either way, I'm glad more people are in the space!
c-smile
According to Tauri's documentation (https://github.com/tauri-apps/tauri) minimal app:
Tauri Electron
Memory Consumption Linux 180 MB 462 MB
Note Tauri is full fledged Client/Server with WebView (client) running in separate process with RPC between UI process and Rust code (Server).For the comparison:
Standalone Sciter (scapp.exe, https://github.com/c-smile/sciter-js-sdk/tree/main/bin) takes ~8 MB of RAM (with minimal Cairo and GDI backends).
That's 20 times less than even Tauri.
WebView based solutions are not suitable for applets - small portable desktop applications.
account-5
I was going to ask how this compared to Scoter, thanks.
mysterydip
Back in the day people coded lightweight because it wouldn't run otherwise, and speed mattered in single core sub-GHz CPUs. We don't have that same constraint today, how do we get people to write more efficient code?
kitsunesoba
Operating systems should being pointing fingers at egregiously heavy apps.
It’s not perfect but the battery menu on macOS pointing out apps consuming a lot of energy has inspired a good amount of efficiency work for macOS ports of things because users see it and gripe at developers about it.
I would like to see that taken a step further. Something like the system showing a notification banner saying something to the effect of, “BadApp is consuming excessive amounts of energy. Quitting it will increase your battery life by approximately 3 hours and 15 minutes.” I believe quantifying the loss that the user is suffering as a result of the developer’s laziness will go a long way to inspire displeasure in users, who will then apply pressure on developers to fix it and opens up space for competitors who sell themselves with better efficiency.
kvark
Power optimization doesn’t improve memory footprint. In fact, it can do the opposite and increase memory allocation. Think tradeoffs between memory and processing, e.g. caching of intermediate results.
fabiospampinato
I think this is a great point. The delta in performance must be visible for people to even care about, and that's not obvious even for technical people (if something takes 15ms or 0.15ms to render the difference is massive, but probably you can't even perceive it with your eyes). Energy usage is a proxy for that that anybody can understand, and care about on a portable machine.
zaps
SDD—Shame-Driven Development. I like it.
burlesona
You can't. Humans are lazy and working within constraints requires discipline and effort. Waste expands to fill the available space. The only thing that made old software efficient is that it wouldn't run if it wasn't efficient enough. And BTW there was crappy old software that made your computer chug back then too, it just looks better now because computers have gotten so much faster that apps can be a lot sloppier before users notice.
rattlesnakedave
People still write efficient code where it counts. There is a trade off between development velocity vs efficiency & reliability. In most consumer software the advantages of building and shipping more frequently largely outweigh saving on compute, memory, or disk, which is historically cheap.
staticassertion
Who says using a ton of RAM isn't efficient? Unless your system OOMs what's the downside of having a bunch of allocated memory? Especially if it isn't even paged in.
throw10920
In general, you're correct - RAM does literally nothing if it's not being used.
Several reasons why this principle doesn't apply in this specific (Electron) situation:
(1) Every single Electron/webtech application I've used hasn't just consumed tons of RAM, but also had a noticeable CPU (-> battery & performance) impact.
(2) Most webtech apps I've seen have had memory consumption in the 200-400 MB range - which isn't a problem on my 16 GB desktop, but is a problem on my 4 GB RAM laptop. People have less RAM than you think, and want to run more applications than just yours. Which is better: to be able to run Spotify, Discord, Slack, Matrix, Obsidian, your web browser and a video game all at once, or to have to manually open and close applications when you OOM?
That is - wasting 200 MB of RAM isn't bad if your available RAM is far in excess of 200 MB. For most people, it isn't. If Electron apps each used only 5 MB more than necessary, you would see virtually no complaints at all.
(3) Inefficiency is making bad use of available resources. Not only are chat applications like Slack and Discord not intrinsically difficult problems, but the very existence of third-party clients like Ripcord[1] show that these applications are making extremely poor use of the resources given.
Karunamon
I do, because your program isn't the only thing running on my system. Low free RAM means paging, and generalized slowdowns when something else RAM-hungry, like a game or a web browser, is invoked.
Memory is a limited resource to be used judiciously, not an all-you-can-eat buffet.
mysterydip
The things you pointed out are the problem. On RAM-heavy machines you're right, it's not noticeable and can even be a performance boost. The problem is that same app is run on machines with all kinds of capacities and system loads.
mehdix
Environment should be the new constraint. Inefficient apps collectively consume energy that otherwise would have been saved and therefore contribute to global warming.
kaba0
Will you also wipe out every old-generation CPU in usage as well? Because a CPU using 4x the energy compared to a modern mobile one will be much more detrimental to the environment than that application running for 2 hours using up 10% more energy.
lkxijlewlf
Get them to stop pushing developer productivity above everything else.
vidarh
You look for places where a potential customer base is unhappy about the slowness, and see if provides an opportunity to compete.
There's little else until/unless people see enough well performing applications that they start complaining or move away from the slow ones.
jstummbillig
People around here seem to really struggle with the miracle that is getting into soft dev from nothing and then actually being employable in the capitalist sense after 6 or so month.
Of course it's a trade off! We enabled this miracle by training people that have a very focused, narrow understanding of not even a field but a particular tech. Electron is basically the perfect fit for this type of education. It enables someone to build something where previously they could build nothing. It makes getting from 0 to 1 that much easier.
From a business standpoint, it's simply smart to be wasteful with resources that are abundant (average computing power on personal devices), when it helps you save on resources that are not (dev time). But of course, there is much not to like about the side effects.
FpUser
>"It enables someone to build something where previously they could build nothing. It makes getting from 0 to 1 that much easier."
Making GUI apps using Electron tech for front end is no less time consuming than doing GUI in Lazarus for example. But the end result is way more frugal in the latter case.
goodpoint
> employable in the capitalist sense after 6 or so month
Bad developers, bloated software and technical debt go hand in hand and eventually bite back.
The world needs more good developers, not just more developers.
torginus
I don't think that the Js devs are entirely to blame for this - Chrome literally eats memory for websites even with little to no Js. That's not to say that some sites are not guilty of this - Reddit is a travesty for example. The problem is that Chrome does things that make sense for a browser - like hanging on to a lot of cached stuff in the page history, or starting a separate renderer process for an iframe, but are horrible ideas when you are running a desktop app.
Additionally, I'm pretty sure stuff like React is also horrible for memory usage - if you create a reference to a HTML element from Js, that means all the native resources that that element uses are subject to GC lifetime, and React, with it's shadow DOM does exactly that.
oscargrouch
i've forked chrome to create something like this (meant for native apps in a multi-process environment) and can confirm.
The multi-process architecture and the chrome platform is already a overkill just for a browser (in my opinion), its much more if for each application you have a browser process + gpu process + several renderers.
If you have only one main process, + 1 gpu and a process for each application running you solve that problem, even more if those process are not running javascript as in my case.
undefined
danuker
Why do people use such a tool? I did not enjoy Electron due to its sluggishness, and I believe that it is a strictly Pareto-inferior solution:
* Creating a web app has the same UI performance, but does not require you to download and update.
* Creating a native app has the same installation and update requirements, but allows much better UI performance.
Icathian
I feel you've answered your own question. If you want to make a single app that can be web or offline, and cross-platform, Electron and friends allow you to do that. It's a trade-off of dev effort for user experience, and as much as many devs hate that philosophy it allows many things to exist that otherwise would not be worth the effort.
danuker
I would distribute a web app as a website, not as an Electron app.
ss108
Because some of us have to build things which, for biz/customer reasons, have to be desktop apps, but we, as devs, are more familiar with web technologies/there are more web libs out there.
pygy_
Because sometimes you want a desktop app right now and are most productive with Web technologies.
jaggirs
Because you can use the same code for both interfaces.
AnIdiotOnTheNet
There is a moderate demand for local desktop applications, but there is a very large supply of Web developers. Solution: by bundling an entire web browser with your application you can have web developers making 'desktop' interfaces.
sdeframond
I believe it is because it is easier to find developpers familiar with the Web than with any other cross platform toolkit.
Put another way, it is easier for a web developer to get started with electron than to learn a new language.
IceWreck
If someone is looking for the Go alternative, there is Wails.
mfollert
> Wails automatically makes your Go methods available to Javascript, so you can call them by name from your frontend! It even generates Typescript versions of the structs used by your Go methods, so you can pass the same data structures between Go and Javascript.
That sounds really great!
OJFord
That does sound really nice - would love that with Tauri.
I've never used Typescript, so at the moment I just have the pain of untyped structures in JS-land (and making sure I get it right passing back in to Rust-land) - but, at least as far as I know, if I did use TS I'd just suffer from manually duplicating data structures instead.
(I suppose ultimately I intend to do that, it's just so imperfect anyway that I haven't bothered yet.)
badrabbit
Is this similar to wails for golang? Whatever happened to Servo, I was hoping for it to compete with webview
Get the top HN stories in your inbox every day.
If anyone wants to know how it works:
> [leverages] WebKit on macOS, WebView2 on Windows and WebKitGTK on Linux.
So cross-platform compatibility isn't guaranteed, unlike Electron.
https://github.com/tauri-apps/tauri