Tauri – Electron alternative written in Rust
tauri.studio
tauri.studio
> [leverages] WebKit on macOS, WebView2 on Windows and WebKitGTK on Linux.
So cross-platform compatibility isn't guaranteed, unlike Electron.
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.
I understand both, I don't agree with either more than the other.
WPF has amazing layouts.
CSS is irritating as hell. Even modern CSS, justify-content, justify-items, seriously?
Flex has so many weird edge cases it is overwhelming. I have used flex type systems in other frameworks that worked 10x better, while Flexbox is way better than what existed before on the web, it is still and endless source of frustration.
And yes, Winforms is 100x more productive than HTML. Awhile back I designed a fully functioning UI in Winforms to get an idea what I wanted my website to look like. I hadn't used Winforms in years. Took me less than a day to get a UI up and running with data binding to my backend and all the features implemented.
TWO MONTHS of web dev later I had the same thing working in a browser.
Now the browser was styled, and responsive, sure. But 2 months vs 6 hours. The loss of productivity there is insane.
What a Qt or other similar frameworks gives you is consistency, all components in all apps will look and work the same (with the exception of customized ones). This means you can focus on UX and not on bad design. My experience is that some bad designer will force his opinion on the users, will force his preferred fonts, font sizes and font colors on the users(making text hard to read), will disabgle text selection for some weird reason, will fuck with the scrollbars because the native ones are ugly etc.
For a working app that is not a music player you don't need the "power" of css, say you seen video games have a small Launcher/config window that hase buttons,drop downs, checkboxes , I noticed those use Qt or Windows Forms. I am also noticing that modding tools , open source tools (that are not GNOME) also focus on functionality and you will not see buttons with round corners, fancy fonts and animated borders.
IMO Electron advantage is not his the "powerfull"css and html and it is that you can reuse the existing node ecosystem and existing web developers and the alternatives are also lacking for higher level languages (GTK is shit IMO)
There is: flexbox and grid. All kinds of alignment can be done with basically a one-liner in both layout systems, without any hacks.
You missed the part with "there should be ONLY 1 way". I know about flex and grid, this are new and thanks the gods we finally we have something decent (not good).
Flexbox is great I wish to magically remove or magically fix all the code that does not use it and instead uses "float" or other shit.
You would say "don't use the other old shit" but my point was that we need a GUI framework that does not have 1 million lines of code for supporting this old stuff. If we really want to use HTMl a language for documents to write GUIs then we should make a new version that is the modern subset of html and css, where you ONLy have 1 way to do a thing (remove or limit the use of float, don't support all boxing models, simplify the layout rules so I don't have to google and find that to make something to work I have to set min=width=0 so the css engine follows a different path and does the correct thing)
Yes, Qt4 is not compatible with Qt3 , Adobe Flex4 was not compatible with Flex3 , I only used at that time this new versions and did not had to work or learn the old stuff. Old projects continued to use the old stuff and continued to work.
It’s amazing how fast the browser can be for this (and tiny) when you aren’t using querySelectors, vDOM, or event listeners.
How do you handle the nuances of GUI and input handling?
Instead of querySelectors I use things like getElementById, getElementsByClassName, getElementsByTagName, and some custom DOM navigation utilities I wrote for this application like getAncestor, getModalsByModalType, getNodesByNodeType, and so forth.
You don't need any kind of framework or fancy wiring to work with events. You always know what you are working with from within the event handler, because event handlers receive an implicit event object as their first argument. From that there is event.target which returns the element the handler is assigned to or event.currentTarget which returns the element the user interacted with that fired the event after bubbling.
State management is also just as easy.
It's more work to reinvent those wheels than bind to them.
It isn't a problem that's so difficult it requires wrapping a 60Mb runtime around every individual app instance.
The world has more than 3 billion internet users
It's called accessibility, and it's a very good thing.
Also, on the web, firefox still exists.
Gecko comes from the heritage of Netscape. Blink comes from the chain of KHTML > WebKit WebCore. They don't share any points, while Blink probably wouldn't have existed without WebKit.
But yes, today there are differences between WebKit and Blink.
> Not sure how familiar you are with the history of browser engines, but Blink and WebKit are definitely more similar than Gecko and Blink.
I see we interpreted parent poster differently, he wasn't talking about the history of rendering engines, but rather compability with the various web specs. Since Chrome forked WebKit quite a long time ago now and Blink has been reworked quite a bit they have deviated from eachothers implementations. Since everyone is trying to follow an open spec it might be that in certain areas FF and Chrome implement more of the same API's than Safari, which doesn't have anything to do with codebase history.
You might and probably will feel more comfortable in the WebKit codebase if you're a Blink developer or vice versa in comparision to Gecko, but that is if you're writing the engine itself and not pressing the pedals (targeting it).
As someone who has been playing with some web dev in early 2000s, that sounds funny. Gecko, WebKit and Blink seem very consistent to me. I remember dealing incompatibilities between IE6 and "standards-compliant" browsers (mainly Firefox/Mozilla Suite back then). And don't get me started on dealing with "classic" Netscape!
`<layer>` tag anyone?
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.
Web views are less standardized though and require more finesse.
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
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?
... 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.
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.
A 60MB download would have been fine.
Indeed, with the annoying habit of proprietary software to install "Download managers" that download the actual software, I would be happy for just a 60MB runtime for the actual program itself.
60MB, even today, is really big when you have to download it while boarding a train or with poor connectivity (even in rich countries, just being in a metallic building is enough for 60MB to be painful to download.
And 60MB would have been a couple of hours, not bad to wait for some software.
It wasn't prohibitive to do this.
Indeed, I seem to be back at square one, as downloading a AAA game for me once again takes about a day.
It was absolutely prohibitive for the average person with a shared line, and the direct comparison to shared line today is a metered connection. Even in the US it can be as much as $30 per gigabyte which would make that 60MB download cost $1.80.
To be short: if you can make your app less greedy - do it.
In some cultures we have a concept of "engineering conscience" (ru: "инженерная совесть"). Are we loosing all that?
https://github.com/tauri-apps/tauri/discussions/3162
> FabianLars, 3 hours ago, Collaborator
> ...for example my somewhat simple app uses ~120MB
> But only ~5MB is the actual tauri/rust process, the rest is WebView2.
So, if 60MB is a large download, surely a simple app using 120MB of ram is pretty outrageous too?
> There is no reason why hello world UI should be 60MB.
Absolutely, but you can't have everything. Fast. Small. Doesn't use any memory. Easy to develop for. Free. Consistent cross platform behaviour.
You can't have them all.
So... the question isn't "is 60MB ok?"
The question is: What do you care about the most? Is it really the download size?
It's not the download size for me.
Maybe you are referring to Gtk/Qt vs. win32 etc. with their integrations in the operating system. I agree that they look and feel the best for their respective OS, but eventually require you maintain multiple unrelated codebases. It is understandable and necessary for this approach to die. A middle ground would be best, say, Qt support on all existing platforms. Or more likely, prettier browser defaults for standard elements like lists and tables, with browsers themselves respecting the underlying OS theme. Probably never gonna happen...
Why? I guess because webkit-gtk is less ram hungry than blink.
> 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.The issue is most common on games that release on consoles, but also for ones that want to support older hardware: the audio formats they use are designed to minimize the amount of decompression necessary for play, and so reduce resource requirements in exchange for storage space.
Would you argue the same for a 60 MB Hello, World application?
I assume this to be a conversion killer. If you have to wait 10 min do download you loose interest in trying it out.
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.
Is there something like WebkitQt? Guess it would use WebEngine.
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.
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.
I get that same feeling when I open an program using it; kind of a 'oh...' slight disappointment. I get that it makes sense sometimes for a developer to sacrifice performance and size for ease of development... but as a user, it feels like a loss, a sign the developer will be taking too many shortcuts, or that I just won't like their general design philosophy.
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.
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.
Not that that would fix the situation, there are still rendering inconsistencies between browsers when using stuff like margins floats and tables.
Having web developers learn C++ and Qt instead would be much more unacceptable.
The platform changed significantly, improved significantly, in the past few years, some of these major advancements can't be ignored just because a browser doesn't implement them.
> The polyfill supports just a limited number of proxy 'traps'. It also works by calling seal on the object passed to Proxy. This means that the properties you want to proxy must be known at creation time.
i.e. that's not a polyfill for Proxy. It's a polyfill for a subset of the thing, maybe that's useful for somebody, but it's useless for the use cases I had for Proxy so far.
Shipping an entire regex engine with your app: right, that's the only way to do something like that. Not that that's actually the same thing though, I can't just load this and use lookarounds as normal, i.e. it's not a polyfill.
For all practical purposes these features are not polyfillable. If your idea of a polyfill includes not actually polyfilling the entire thing or shipping an entire engine with your app then sure, anything is polyfillable, you could even run Java in the browser.
You mean like shipping an entire 100+ MB browser and rendering engine with your app?
Less testing, less bugs. Whats not to like?
Contrast to Chrome first developers who often get caught by cross browsers incompatibilities just like they did back in the days when they were IE first developers : )
Writing for a standards compliant browser like Firefox makes your code more well defined today just as it did back then because you won't get away with the same sloppyness. (This also makes you catch and fix problems in early iterations over the problem instead of after QA calls to complain so it saves you time and context switching too and if you are good you might look like a cross browser superhero almost for free ;-)
Earlier on not every basic thing was supported everywhere, many people here will remember the ACID tests. Younger devs won't remember them as we stopped talking about them after every browser became compliant. Today every mainstream browser has comprehensive test suites to cover everything we need from CSS I think.
How?
> caniuse.com kinda works better for that as you get data about other browsers too.
caniuse.com is nice but unlike using a standards compliant browser it requires you to be mentally alert and aware of it.
Using a standards compliant browser means you'll see the result of sloppy css immediately on the screen.
Sorry I meant "Firefox" and "Chrome-only" there.
In general though it's not like Firefox is spec compliant and others aren't, pretty much every browser works a little different in some areas. Just for the sake of saying something verifiable: no browser is spec compliant because the spec mandates a precise maximum length for strings and each main browser has a different, arbitrary (= I have the RAM, they just won't let me use it), lower limit on that.
I'm not entirely sure how I feel about this statement (and comparison to IE). If anything, Safari is "the new IE" rather than Chrome.
MOST (hopefully the nitpickers pick up the caps lock) stuff in Chrome are drafts or standards.
Sure, Google pioneered/championed some of them, but that's kinda irrelevant if developers voted for those features. There's very little Chrome-specific stuff.
Also, other browsers have vendor specific stuff in them too, yet people rarely fling shit in their direction?
FWIW I also mostly use Firefox for dev because I prefer how some devtool features are designed/implemented.
Most of my cross browser issues in FF were "brief" in the senses that they were bugs that got fixed eventual.
Some people who either don't know history or willfully ignores it keeps claiming that Safari is the new IE, at one point one even made a webside out of it.
Don't fall for it.
Chrome is the new IE:
- technologically advanced? Check!
- implement a number of things without asking or waiting for consensus? Check!
- will be abandoned as soon as they have crushed every competitor? Well, it is produced by the worlds most famous company when it comes to killing its own software.
Next up, Microsoft is going to abandon Word. Also, Facebook is going to abandon Facebook. This is why no one takes these conversations seriously. All vitriol, no substance.
I doubt google would spend much on chrome if no other browser were popular.
Fork Chromium.
Love, Your Old Users
Sure, some piece of software will have that name, but it won’t be aggressively developed like MS abandoned IE a few times.
I also won’t be shocked if Word or Facebook are like Edge where it’s a new different thing with an old name.
There are plenty of gotchas in layout/rendering as well, where either the standard is under specified, or Firefox has some small bugs. Maybe Chrome has many-chrome only APIs, but the developer will always need to test in Chrome and iOS Safari 13 (or whatever your oldest supported iOS version is).
Chrome and iOS are where the users are, and a good website or app should be usable and beautiful for everyone.
1/5, would not recommend. (But sometimes there's no way around it.)
Just wondering where you're getting "30 years" from?
That asked, a Chrome-shaped monoculture doesn't help anybody. We need more competing implementations, not less. Anyone feel like collaborating on such?
But this it not for "web devs", but for general UI development on desktops. Given some conventions there are decades old 4-5 years does not sound very ancient in comparison. And for desktop you probably want to trade bleeding edge hotness for tested and tried methods anyway. 4-5 years on desktop is a very brief span of time.
No it's not. "Web dev" is one of the things in my toolbox and I still clicked on this well-knowing it was likely not truly cross-platform and keeping up with bleeding-edge features.
Truth is all development is about tradeoffs and Electron is one heck of a blob to ship to users... in a lot of applications a lighter weight artifact may be desirable where the trade off of the last 4-5 years of browser advancements may be perfectly OK.
Is it unacceptable? Sure - if your application needs features out of the last 4-5 years of browser advancements... but that's not most applications. If you need a bleeding-edge solution that's truly cross-platform then Electron clearly still is your choice as you're just shipping around a fancied up Chromium.
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).
- The performance you are going to get will be terrible compared to the native implementation.
- Oniguruma, which I think is Ruby's engine, weighs half a megabyte on its own, that's comparable to the core bundle of the app I'm working on. That's a lot to my eyes.
- If you need to use this engine in dependencies that just assume that lookarounds are available then you are going to need to fork every single dependency just to wire it with the regex engine you compiled, super messy.
.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.
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.
The world has circled back to the bad practices around IE 6! History doesn't repeat, but it sure does rhyme!
[1]: https://developer.mozilla.org/en-US/docs/Web/Media/Formats/A...
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.
Safari development does seem to go through spurts, depending on who is working at Apple. Let's not forget that in the past, it's been a major driver of web innovation, particularly in the late 2000s to early 2010s.
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.
</obligatory physics joke>
It might mean more testing for developers, but it's a benefit for users.
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]
Downside? :)
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.
[1]: https://github.com/tauri-apps/wry
Edit to correct that Tauri uses Wry and not Webview.
Drake approving: Any modern game requiring 100GB of content
1Password, 155mb
Discord, 441mb
Element: 38.7mb
Signal: 91mb
Slack: 46.2mb
A few higher but a couple that are lower...
Some time later, some of these numbers have changed a bunch. I'm on a desktop so it's always on. Element has climbed up to 800mb of usage. Signal's dropped to 44mb. I closed Slack after posting that comment. Discord's about the same. I now have VS: Code open, it's taking up 626 mb.
Electron generally isn't doing anything more interesting than what we did on Win98 with 8MB of ram for the entire system.
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.
To what extent is Electron's popularity due to getting cross-platform availability without writing your code 3x?
The advantages of a native app have to be worth the costs... and I'm seeing plenty of Electron apps so there's a lot of people making that cost-benefit tradeoff.
I share the dislike for bloated apps... but every time my stuff takes 10 seconds to start up I think more about keeping it running the whole day than submitting a PR to remove cruft.
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.
- 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++)
yes, Telegram looks so bad right ?
https://github.com/electron/electron/blob/main/LICENSE
So everyone can use it without the need to expose his IP.
See for instance one of the most core Blink data structures: https://chromium.googlesource.com/chromium/blink/+/refs/head...
That is the exact same license than Qt, you do not need to expose your IP when using it (Tesla used LGPL Qt for their car dashboards and you don't see that IP floating around on the internet)
As for the stability of the front-end ecosystem, it doesn't exist. The many articles that were posted on HN over the years complaining about the endless quagmire of front-end frameworks, libraries and technologies explain this better than I could.
I can easily imagine that, because that's more or less what we had before Electron. And it was much better, because apps (mostly) looked consistent across the OS, rather than each and every one coming up with its own custom UI theme.
> 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.
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.
This is what happens when you keep lowering the bar, and more and more developers can do less and less.
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.
Not working on iOS
What do you mean then, how does the hypothetical OS differ from ChromeOS?
It makes perfect business sense to use electron. It opens paths which otherwise would be very costly and hence infeasible.
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.
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.
Windows 10, pulling in part of an engineering drawing from a PDF (so many thousands of objects).
To wit: I’m known on the team for sussing out information from corrupted PSDs, and get called on about once a quarter to look into a bad file that’s come in. That wouldn’t happen as frequently without the community site.
I would rather have one team developing a cross-platform application in a language that isn't Javascript.
Perhaps Unity? But that's more tailored for 3d scenes, rather than UI widgets.
Genuinely looking for suggestions on what is the best choice to pick there.
So, use one of the many languages that compile to JS. Starting with TypeScript. Or (alphabetically) ClojureScript, Elm, PureScript, or Rescript.
Should I not use anything that uses ML if I dislike python?
Would that work?
I am not a front end kind of developer, I am a "plumber". So it is a genuine question.
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.
There are just two of us building this product.
I wonder if someone can quantify the carbon impact of Electron just from Slack.
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.
Writing native apps (or a Qt app) would well be in reach of Slack. In fact, they already have native apps. E.g. Slack for iOS/iPadOS is native [3], just allowing M1 Mac users to use the iPadOS version would most likely be a large net improvement in resource use for those who'd choose to install the iPadOS version. Unfortunately, they disallow iPadOS installs on macOS to force people to use the terrible Electron version.
[1] https://cancel.fm/ripcord/
[3] https://twitter.com/slackhq/status/931599784137363459?lang=e...
Because I can honestly understand going cross-platform by a small startup that can’t finance n*numOfPlatforms devs, but for Slack and the like it makes zero sense to me.
[1] To help provide more context: https://supernotes.app/
That's a different penalty. Qt doesn't really compare with what can be done with a good UX/UI dev on the team, and in much less time. And there are far more front-end devs than Qt experts.
Those are orthogonal. UI/UX is platform-agnostic - if you're only developing Electron UIs, you're not actually good at UI/UX.
> in much less time
Are you telling me that an Electron developer will be able to implement a system significantly faster than an equally-experienced Qt developer?
> there are far more front-end devs than Qt experts
You don't need to be an "expert" to use Qt - it has a relatively simple API for simple use-cases - it's not rocket science or distributed computing.
Yes. Hands down.
I'm actually saying two things: there are far fewer Qt developers, and the learning curve is much steeper. This has huge impact on maintaining and improving the code. We started with Qt and abandoned it because it is way easier to bring someone new in and get them started than having someone climb the curve to learn Qt and C++. Plus spinning up new features in Qt is laughably slow compared to how quickly a frontend dev can do the same in Electron: the former takes days, the latter is practically interactive.
It was such a clear choice to abandon Qt.
I was primarily worried Electron wouldn't last long, but we wrote our first app with it 6 years ago and it has remained completely stable. The biggest dev hits have been in Node peripheral support as they get better, like BLE and serial port interfaces.
I've had direct experience with this myself - with no prior Qt or webdev experience (although knowledge of how JS the language works), it took me only around an hour to figure out how to write a Qt application - but after 5 hours (and counting) of struggling with Angular, I wasn't able to figure out how to use it.
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/ ).
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.
(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.
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.
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).
That said, I've mentioned WPF mostly because that's what I'm personally familiar with. The same inspector-type tooling is available for newer XAML-based frameworks, as well:
https://docs.microsoft.com/en-us/visualstudio/xaml-tools/ins...
Flutter Desktop works great, and there are a bunch of nice GUI libraries for Rust, also some new developments for the JRE.
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.
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)
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?
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.
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.
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.
Your example of an <img> is a perfect one. Yes, if all the images are going to be loaded remotely, I would say this is a client/server messaging paradigm, and one that excels in digital publishing.
However, if you're going to build an app (which is what we're talking about), then you are probably going to want to store the app's images in one giant executable... which means all the caching and everything you want is going to be extremely fast, probably much faster than what the browser will do for the same task.
If you really want to understand what I mean, just ask yourself "what is the life-cycle of a web app", e.g. what is the "main" method? Are there clearly defined transitions between views? What is the execution/memory model?
When you answer those questions you realize that the browser was built to display pages of text and images, loaded by a server. From there it should be clear why people don't think there's any comparison when it comes to building apps, because one was designed for it and the other inherited that responsibility.
I'm not saying web development as a paradigm isn't popular, but I'm arguing against it being easier than native because it's not really. However, if you wanted to add like a digital publishing component to an app, I'd just embed it into a web view, which is the best technical choice.
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.
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.
When the browser is the OS - or the other way around.
The best thing about electron is that it brings apps that otherwise would be locked to Windows (and probably Mac) to Linux.
https://github.com/webview/webview
...I wouldn't go as far as calling a simple WebView widget wrapper an "Electron alternative" though.
Source: https://tauri.studio/en/docs/about/intro#polyglots-not-silos
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.
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).
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.
Either way, I'm glad more people are in the space!
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.
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.
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.
It is a lot faster if you already know web tech stack, and you would have to learn Lazarus/pascal
In any way I am all in for the type of developers that know how to screw size 8 bolt into size 8 nut and the rest be damned. It keeps some healthy niche and remuneration for little more versatile types.
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.
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.
There's little else until/unless people see enough well performing applications that they start complaining or move away from the slow ones.
Besides, memory usage is hard to measure. Lots of memory may never get paged in.
Memory is a limited resource to be used judiciously, not an all-you-can-eat buffet.
At the end of the day, if my system wildly misbehaves under high memory pressure, and forcing the pressure down resolves the misbehavior (or keeping a certain amount of headroom prevents it from happening outright), "linux ate my ram" is an accurate description of what happened and no amount of tut-tutting telling me that it doesn't work the way I just got done seeing it work changes that.
I'll give zram a try, but the problem here is poor usage of memory (both in priority and badly-behaved bloatware), not quantity of memory available. I'm not a kernel developer, I shouldn't have to dork around with these kinds of knobs to get sane behavior.
Worse, this often happens when there's plenty of cache to evict. I can and have restored a nigh-unusable desktop to normal operation many times with a painfully entered `echo 3 > /proc/sys/vm/drop_caches` from a new TTY, instantly resolving the pressure and giving me time to find and terminate the presumptuous program who thinks its entitled to 3/4 of system memory (usually some flavor of web browser or electron bloatware).
Why's the kernel so jealously guarding its cache allocation and making the UX suck harder? Not a clue. Whatever performance penalty I take from nuking caches is far, far less than from allowing free memory to fill up and dealing with the pathological behavior surrounding that.
Just to again note that just because a program says it's using N MB of RAM doesn't mean that all of that RAM is actually paged in. Every thread you execute has an 8+MB stack but most of it won't get allocated for the majority of programs.
> we start digging into swap, and at that point, the UI is starting to significantly chug.
Only if you're constantly swapping in and out of swap. Just putting something into swap and never retrieving it won't case issues.
I'd generally recommend disabling swap altogether though and just letting OOM take out misbehaving processes.
This isn't all to say that using less memory is 'bad', but when people say 'oh that program is such a memory hog' I wonder if they might be measuring incorrectly, or not realizing what it's doing with that memory.
Which, in the experience I just gave, is what's happening. System memory at some high 90s percent utilization, swap usage creeping up, kswapd with a ton of CPU usage, and worst of all, UI chugging. If it wasn't 'actual' memory usage, why does dropping caches, instantly freeing up some amount of memory, restore responsiveness?
I've tried operating swapless before, but that just means OOM killer kicks in even when there's cache to evict. That seems like a priority inversion to me - of anything paged in, shouldn't cache have the absolute lowest priority, and be the first thing to go when memory's needed for other things?
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.
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.
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.
* 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.
Put another way, it is easier for a web developer to get started with electron than to learn a new language.
That sounds really great!
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.)
As I understand, the heavy resource use of these apps is due to Chrome, replacing the thin OS shim with something, hardly curbs the resource usage.
Web tech is ultimately an API. APIs don't create bloat, developers do.
What is missing (or unknown) is tooling to avoid bloat.
One could have something like a compiler of sorts that analyses the HTML+CSS+JS of an app to be packaged and generates just enough code to implement what's actually in use. It only needs to implement the semantic (for example no need for a CSS parser in the app if the CSS is not generated on the fly in response to user interaction, it can compile straight to layout code).
Even packaging an existing browsing engine, it should be possible with a bit care (no aggressive use of runtime generated code and the like) to make an advanced dead code remover that recompiles the embedded browser without all the stuff the app being packaged does not use (e.g. no video => no video decoding code, no use of CSS feature XYZ => not compiled in). It could even be brute forced in the presence of an exhaustive test suite: for each function in the embedded browser, replace the body with an exception, run the test suite, remove if it passes, repeat.
This also applies to GTK or Qt which suffer the same problem as electron (must be co-packaged with the distro, or compiled on): with efficient dead code removal you could make AppImages (or similar all-in formats) that are not zillions megabytes each.
[1] https://github.com/tauri-apps/wry
(edited to fix that Tauri uses Wry and not Webview)
Wry said to use 'default web engine', which under Gnome is libwebkitgtk(i.e. webkit engine), that is different from its default browser firefox which uses Gecko as the engine.
so Electron and Tauri both will bring their own demanding/heavy cpu/memory needs from their built-in web-engine that shares nothing with your already running heavy browsers. Neither is a light-weight solution.
Anyways other than Tauri is a Rust-flavor, on the resource usage side, it shall not have much difference from using Electron, which uses Nodejs.
Why not just run a local server (localhost should be secure)? I mean: You create a web app and kind of a backend / some logic anyway.
You could embed all assets and the server into one executable file and distribute it. The user then runs this executable and uses their default system browser.
Our compilation times are long.
Those sweet, ergonomic macro interfaces are only possible because of proc-macro dark magic that tends to be very verbose and special case-y.
There's no spec.
Unsafe is overused.
Et cetera.
(See also: https://blog.rust-lang.org/2021/08/03/GATs-stabilization-pus...)
[Citation needed]. Because when your unique selling point is "it's like $otherproduct but written in $language" then well ...
Rust is #1 loved language, almost 20 points above the second one.
The language ultimately chosen for the project ended up being 100% a political contest, and that language was not Rust.
I'll cite my own experience:
I learned Rust because I needed a modern systems language in my toolbox. I specifically wanted something that could be used to write firmware. So I chose Rust over alternatives like Go or D, because I couldn't tolerate a garbage collector with those requirements. Trendiness had nothing to do with it; in fact, I was hesitant to pick it up because I was worried it wouldn't have staying power. (Having taken the plunge, I have no regrets.)
I think the criticism/meme is directed more at overly enthusiastic fans of Rust. Even if a project doesn't promote itself as "Written in Rust!", that's how it gets promoted online by the fanboys. It IS a substantial criticism, as generally they are not doing the credibility of these projects any favors.
People are actually building stuff in Rust because they have, for whatever reason, decided they care about that language and ecosystem. There's no requirement that _you_ care about it. But the reasonable response to seeing something you aren't interested in is to do something else, and to leave the discussion to those who are interested. Entering the conversation just to let everyone know you don't care is tiresome and gratuitous.
It's pretty common for people to tag a tool with the language it's written in. It's interesting information. For instance, I don't work with JavaScript, so I'm not particularly interested in what's happening in that ecosystem. Putting JavaScript in the title lets me know I'm probably not the audience. People don't seem to complain about posts like, "Foo: Bar for JavaScript".
The "Rust is for clout" meme exists in the minds of it's detractors, not in the minds of the people who are actually writing in it. So no, it isn't substantive. It's more a form of straw man. "I don't care about this thing, and no one else should either, because it isn't a real language. It's just for karma."
Here's a thought experiment. Let's say that writing something in Rust really is the recipe to hit the front page of HN. Why is it that that works? Can it be for any reason other than there's a lot of people who are interested and want to learn more about it?
And if you're not one of those people - doesn't it make the most sense to just click a different article?
No one broadly commenting on the "... written in Rust!" meme is saying that they "don't care". They are saying that they DO care. About the clout-chasing aspect, going unchallenged, clogging up a generally high-quality forum with what amounts to spam or clickbait.
If you get a lot of spam in your email inbox, you would take a dim view toward the pompous admonition, "If you are are not interested in homeopathic erectile dysfunction pills, then you are free to scroll onward and leave it to those who are". In the case of a message you DO happen to be interested in, you would still right to discourage the use of clickbait tactics or dark patterns with that message.
BOTTOM LINE: Either the topic of this this post is "Tauri", or the topic of this post is "Rust".
* If the topic is Tauri, then the clickbait meme detracts from the topic (I note with interest that the Tauri project itself does NOT promote itself on the basis of its implementation language).
* If the topic of this post is Rust, then well... I honestly think you'd be better served promoting a single "Look at all of these 'serious' projects written in Rust!" post, rather than sidejacking a myriad of topics individually in a clickbaity manner.
Either way, if you don't care about the spam/clickbait criticisms that always arise in these threads, then I invite you to leave that discussion to those who are interested.
The problem with spam is that it is involuntary and fraudulent. The thing about articles on Rust is that participation is voluntary, and the claims they are only for clout are untrue, as I've argued.
I'd be curious what your answers to my thought experiments are.
ETA: I apologize for making you feel admonished, that wasn't my intention. I'm really not interested in criticizing you or anyone as people, but the behavior and the sentiment behind it. My intention wasn't to throw mud, but to hold up a mirror and show how this message is received; I did my honest best to compose a convincing counter argument, and the reaction I was going for was, "Gee, I hadn't thought of it that way", and not, "This jerk is calling me out."
that is the only thing i remember of the countless of projects advertised on hackernews, "written in Rust", they still haven't got it, the language is the least important piece of a product
Not only are the instructions on their website incorrect for building & installation on M1 Macs, you cannot run the app without it crashing on M1. https://github.com/tauri-apps/tauri/issues/2421 https://github.com/tauri-apps/tauri/issues/2934
These things are not a big deal! Bugs happen. I would be more than happy to contribute and try to help fix these things. However, when this was mentioned (politely!) to the devs in the discord by a user one was actively hostile in reply: https://imgur.com/a/sHzSaae
This does not seem like a team that cares about its users one bit. I'll take the perf hit (is there one?) and stick to electron.
EDIT: After posting this knee jerk comment spawned from a night of frustration using Tauri a couple weeks ago, I think I would like to retract calling it a “horrible project.” It’s technically interesting, and even good (when it works, I hear), but this was easily the worst experience I’ve ever had in FOSS.
I don’t know if this is a reason to embargo a project in its entire (is this person in charge? What do the other devs think of this behavior?), but jeez, that is unpleasant.
I'd expect them to have some sort of code of conduct and remain compliant to it.
I'll not bemoan folks choice of comms channels, just would be nice to have a consistent place to do it. Between Gitter, slack, IRC, Discord, and others, fragmentation of chat clients is annoying. Pidgin solved this all a long time ago but then XMPP got dumped.
by Google and Facebook.
What is open standard used today?
Does that speak to technical competence of the project? Not sure. This seems pretty mild compared to Linus Torvalds' infamous excoriations.
That said, I would hope the maintainers and devs would spend time reviewing issues to become familiar with the feedback, at a minimum.
I for one want a faster Electron, and Rust sounds like a great way to get there.
More seriously, you’re correct. See the new edit. Likely a good project, just doesn’t work well on M1 AFAIK, and doesn’t seem super friendly.
I'm glad to see that you've retracted this, but note per HN Commenting Guidelines: "Please don't post shallow dismissals, especially of other people's work. A good critical comment teaches us something."
I have to say, this was a quite unpleasant and unwelcoming interaction as my question was genuine and I indeed did do some extensive research before asking this question in Discord.
As a devtools founder myself (co-founded www.prisma.io) I highly value welcoming and helpful communities and offered my help to the people behind the Tauri project to turn it into a more welcoming community. I hope they are open to it since I actually really enjoy using Tauri as a project.
Denjell here from the founding team of Tauri. Thanks for reaching out directly, and I just wanted to state for the HN record, that we are going to be having a board discussion surrounding the unpleasant event raised here, and will make a public statement very soon.
That said, on a personal note, I am quite sorry this happened. We do support and uphold our Code of Conduct, and this is not an appropriate response and the community tone we want to nurture.
But the contents aren't very problematic. This is one person tired of repeating himself in a chat.
The issues up there have a much more reasonable discussion.
I wouldn't embargo the project due to it, but it's worth looking if they have a better channel than the discord one. Anyway, the Mac isn't a good environment for webviewers (notice that there are other projects with this same known bug).