News for hackers. Stuff that matters.
Re:Building a Slack alternative with Rust/Tauri by Sytten on Tuesday June 20, 2023 @07:34PM (#36412265)
I build and ship a production application using tauri and linux support is the most painful experience I had in a long time.

They use WebKit GTK which is really not a good fondation IMO, its hard to test for all versions, its much slower than other browser, it has weird bugs.

In general the idea of not shipping a browser bundle is nice, in practice it doesn't really work for a startup. It's just too much unrelated testing and debugging work you need to do to support old outdated systems.

We were very excited to use tauri since we are a rust shop, but we are strongly considering moving to electron unless we get a way to bundle a renderer.

Re:Building a Slack alternative with Rust/Tauri by rickstanley on Tuesday June 20, 2023 @08:21PM (#36412674)
Thanks for sharing the experience.

From time to time, I go to https://www.areweguiyet.com/ to check out how rust GUI is doing.

I've heard good things about Iced framework (the one that System76 is building their DE on).

Re:Building a Slack alternative with Rust/Tauri by chrismorgan on Wednesday June 21, 2023 @03:07AM (#36415344)
But do note (given the context of this discussion) that Iced is completely unsuitable for the web. Early on it had an actual web renderer (iced_web), but they stopped maintaining it and it doesn’t work any more, so what you get if you use Iced on the web is the pure-canvas approach, which is fundamentally and irredeemably unsuitable for general-purpose web content and apps. (I’ve written about this a number of times here on HN; https://news.ycombinator.com/item?id=33861831 is one.)

By all means use it on desktop platforms, but it won’t get you an acceptable web version.

Re:Building a Slack alternative with Rust/Tauri by lifthrasiir on Tuesday June 20, 2023 @09:13PM (#36413092)
I have used Tauri (or more accurately, WRY) for Windows and macOS and it worked very great in my opinion. It still needed some tweaks to suit my needs, which was the main reason I didn't use Tauri proper, but I guess your issues are more related to the lack of well-known system web view in linux. It might make sense for Tauri to bundle the browser engine only for linux if this is a big concern.
Re:Building a Slack alternative with Rust/Tauri by nine_k on Tuesday June 20, 2023 @11:43PM (#36414142)
Shipping an AppImage as an option could help bundle everything needed.
Re:Building a Slack alternative with Rust/Tauri by Sytten on Wednesday June 21, 2023 @08:07AM (#36417414)
That is what we did when we hit a WebKit bug that caused our users to not be able to launch the app at all. But people dont like it.
Re:Building a Slack alternative with Rust/Tauri by remram on Tuesday June 20, 2023 @10:19PM (#36413583)
I think using Electron is excusable if you are a startup, like you said your time is limited.

It's much less acceptable if you are Slack and still ship a slow bloated Electron app 10 years in.

Re:Building a Slack alternative with Rust/Tauri by nine_k on Tuesday June 20, 2023 @11:31PM (#36414058)
The truth us that once you have shipped Electron, there's no way back, the cost of switching is too high.

This is not specific to Electron, it's a similar effect with every core technology, all the way to COBOL.

Re:Building a Slack alternative with Rust/Tauri by dathinab on Wednesday June 21, 2023 @04:51AM (#36416064)
Most electron apps are (mostly but not solely) a bundling of the web-app.

So the cost is less the cost of "switching" and more the cost of initially writing a native app.

In turn the actual question is how to reuse as much code as possible between the web-app and native apps without it introducing a lot of friction.

And one of the few reliable, nicely (developer) usable answers for this is currently electron.

For "business logic" there somewhat are already other answers, some languages run on most targets reliable and there is also wasm which often still needs a bit more tooling but has a lot of potential for such use cases (e.g. see Disney which AFIK does have their core business logic compiled to a wasm blob and then "only" provide UI/system glue to bundle it in on all platforms their streaming app runs on).

The problem is UI, you really don't want to reimplement UI and the mapping of non HTML/CSS producing UI to a mix of HTML/CSS on some platforms and native components on other often doesn't work grate so it's not surprising people decided to "just go with HTML/CSS everywhere". And if you are already there going with electron isn't "that" much more overhead.

Re:Building a Slack alternative with Rust/Tauri by theappsecguy on Wednesday June 21, 2023 @09:02AM (#36417922)
This right here. Something monumental would have to happen for senior leadership to green light a rewrite, because that’s a massive project that will bring in no additional revenue.
Re:Building a Slack alternative with Rust/Tauri by remram on Wednesday June 21, 2023 @05:59PM (#36425254)
That they are content with mediocrity, I have observed, but they deserve to be called mediocre. "It's Electron" is not an excuse.
Re:Building a Slack alternative with Rust/Tauri by tylercrompton on Wednesday June 21, 2023 @01:01AM (#36414573)
What exactly makes Electron better for speed than say popular cross-platform GUI library X?
Re:Building a Slack alternative with Rust/Tauri by friendzis on Wednesday June 21, 2023 @01:12AM (#36414638)
Webviews are built on weakly, dynamically typed languages, which naturally have development speed advantage over statically typed languages in the happy path. On top of that you have multitude of frameworks even more optimized for the happy path. It is much faster to create an MVP of a GUI with web technologies.
Re:Building a Slack alternative with Rust/Tauri by tomkarho on Wednesday June 21, 2023 @01:27AM (#36414706)
Also the same GUI code translates (kind of) to more platforms easier than writing it all from scratch. Web, desktop, mobile. Almost one codebase can be used for all three.

Could you do the same with say, Java (and maybe soon with .NET)? Maybe. But web has a lower barrier for entry and faster speed of development cycle. Not to mention larger pool of developers available.

All of this translates to two pretty much essential features for any startup: speedy entry to market (MVP) and low cost. And once you get going, it is really hard to pivot your technology stack to something else.

Re:Building a Slack alternative with Rust/Tauri by friendzis on Wednesday June 21, 2023 @01:45AM (#36414825)
> Also the same GUI code translates (kind of) to more platforms easier than writing it all from scratch.

With an exception of web there are very solid GUI cross-platform (linux, windows, mac) frameworks out there. Qt is even pretty good at targeting native look.

> All of this translates to two pretty much essential features for any startup: speedy entry to market (MVP) and low cost.

Yes, web technologies let you build MVPs faster, that's literally in my original comment. However, in order to provide quick MVPs these technologies inherently sacrifice long term maintainability.

Re:Building a Slack alternative with Rust/Tauri by Capricorn2481 on Wednesday June 21, 2023 @11:25AM (#36419741)
QT is just gonna be untenable for most people. Learning C++ is hard enough, but learning QT is basically a different dialect of C++, and I can't even say it's worth the investment.
Re:Building a Slack alternative with Rust/Tauri by auggierose on Wednesday June 21, 2023 @04:14AM (#36415810)
Third time I am hearing about the "happy path" lately. This phrase seems to become popular quickly.
Re:Building a Slack alternative with Rust/Tauri by x0x0 on Wednesday June 21, 2023 @01:40AM (#36414789)
The massive advantage of Electron is write once -- with some extra overhead, perhaps 40% effort -- and you can ship the same app to web, mac, windows, ios, android, and linux.
Re:Building a Slack alternative with Rust/Tauri by prmoustache on Wednesday June 21, 2023 @02:42AM (#36415187)
I'd like to be explained why MS teams electron app is so different to the web version then.
Re:Building a Slack alternative with Rust/Tauri by dathinab on Wednesday June 21, 2023 @05:41AM (#36416424)
I would like to know it, too.

MS seems to be using electron in the worst possible way.

I mean it's basically running an outdated version of the web version bundled into a even more absurdly outdated version of electrone.

Given how bad the decision is it really looks like it's just for ticking of some checkbox and avoiding claims that MS is intentionally hurting other desktop system... but honestly they way they did it makes it look even more like that.

Through there are technical reasons AFIK:

- it seems to be that they have some custom native "call/video/screen-capture" code, which doesn't seem to provide any sustainable benefits but is less reliable AFIK.

- (speculative) for some time in the not that distant past (Chrome <v110) on Wayland desktops for screen sharing Chrome did only support an older experimental version of the protocol, locked behind an experimental flag. Through most distros set up pipewire in a way where the old protocol was still supported (on the fly converted) and even through the chrome flag was experimental it did work very reliable. So re-implementing pipewire support by hand would have been quite of an stupid decision I hope Teams didn't do.

Re:Building a Slack alternative with Rust/Tauri by meepmorp on Wednesday June 21, 2023 @06:34AM (#36416793)
Also, the web version works better than the electron app (for me, ymmv).
Re:Building a Slack alternative with Rust/Tauri by prmoustache on Wednesday June 21, 2023 @08:54AM (#36417841)
Can't speak about other OSes but that is the case for me on linux.

And I hace seen quite a few people on windows who literally has to reboot because teams app was working erratically or was freezing and no amount of stopping/restarting the app would help.

Re:Building a Slack alternative with Rust/Tauri by ohgodplsno on Wednesday June 21, 2023 @04:17AM (#36415826)
Write once and provide a terrible experience to web, mac, windows, linux and an absolutely unusable piece of crap on iOS and Android.
Re:Building a Slack alternative with Rust/Tauri by cmrdporcupine on Wednesday June 21, 2023 @08:21AM (#36417538)
Well, s/Electron/WebUI generally, the conclusion that I came to last year was beyond Qt there really isn't a decent cross platform UI toolkit out there that really handles all the nitty gritty details like accessibility, proper GPU acceleration, etc. And Qt comes with its own normative lifestyle assumptions. And there is this huge community of HTML/JS/TypeScript developers and a pile of UI frameworks for them.

So if you're looking to build a cross platform desktop application, you want to also be able to service it on web, and you want to be able to hire beyond the limited Qt/C++ talent pool, it just makes sense.

Re:Building a Slack alternative with Rust/Tauri by txdv on Wednesday June 21, 2023 @12:20AM (#36414358)
I wanted to have apple notes on linux, so I used tauri and just redirected to the apple notes web app.

I could really feel the lag and the lack of snappiness when interacting with that UI.

Its webkit, safari also uses webkit? Why is it so slow?

Re:Building a Slack alternative with Rust/Tauri by PaulRobinson on Wednesday June 21, 2023 @01:55AM (#36414900)
I think you might be confusing an OS web view - which is what Tauri uses - with WebKit, which is the web view on Apple operating systems. It’s the way to get Safari inside your app if you are on an Apple device. On Linux, there is no WebKit, the web view will be your system browser. That might not be very fast.
Re:Building a Slack alternative with Rust/Tauri by saagarjha on Wednesday June 21, 2023 @02:04AM (#36414954)
WebKit definitely compiles for Linux. You can try it in GNOME Web.
Re:Building a Slack alternative with Rust/Tauri by c-hendricks on Wednesday June 21, 2023 @11:40AM (#36419976)
Tauri uses WebkitGTK, which has pretty bad performance compared to other browsers on the same hardware.

https://github.com/tauri-apps/wry/issues/890#issuecomment-14...

Re:Building a Slack alternative with Rust/Tauri by creshal on Wednesday June 21, 2023 @05:34AM (#36416367)
WebKit is five loosely related browser engines in a trench coat. A lot of the code is "platform" specific, and most of the optimization happens in that layer. Apple's Cocoa webkit is a lot more polished than WebkitGTK could ever hope to be with its meagre dev resources.
Re:Building a Slack alternative with Rust/Tauri by pjmlp on Wednesday June 21, 2023 @02:11AM (#36415001)
Here is an idea, do a Web application.

Most of the Electron junk can be easily done as pure Web application, of course authors don't want to pay for hosting and ship a browser and server with the application.

There are a very tiny percentage of such startup ideas that really need features not available on a standard Web browser.

Re:Building a Slack alternative with Rust/Tauri by graftak on Wednesday June 21, 2023 @04:28AM (#36415913)
Now that at least Windows, Chrome OS, and soon macOS properly support PWAs it will finally get feasible to add web apps to your desktop environment. I know I’ll upgrade to the new macOS ASAP just to get rid of slack.

(I don’t know about Linux).

Re:Building a Slack alternative with Rust/Tauri by nottorp on Wednesday June 21, 2023 @05:04AM (#36416170)
Just because you can put a link to a site on your desktop and make it run in its own window (and maybe process) it will make the "app" less bloated?
Re:Building a Slack alternative with Rust/Tauri by graftak on Wednesday June 21, 2023 @06:31AM (#36416764)
Yes because electron comes with its own distinct instance of chrome (usually an outdated version) for each individual app, introducing massive overhead versus running on the OS provided browser engine.
Re:Building a Slack alternative with Rust/Tauri by nottorp on Wednesday June 21, 2023 @06:59AM (#36416932)
It will still be a browser and a modern "app" done by people who think guis should refresh at 120 fps instead of just when something changed on screen...
Re:Building a Slack alternative with Rust/Tauri by Sytten on Wednesday June 21, 2023 @08:04AM (#36417393)
Funny enough that is exactly what we did and our users asked for a desktop application since this is what they were used to by our competitor.
Re:Building a Slack alternative with Rust/Tauri by cmrdporcupine on Wednesday June 21, 2023 @08:18AM (#36417512)
I tried this same approach (embedded webview instead of e.g. electron -- https://github.com/rdaum/vstwebview) for something last year and I agree the biggest problem is Linux support, specifically WebKit GTK.

On Windows, and to a lesser degree on the Mac, this approach actually went pretty smoothly. But WebKit GTK introduces all sorts of problems -- having to tie into GTK's event loop even though you don't want it, dealing with distribution variances, event binding issues, etc.

I suspect the answer here for Tauri is that someone needs to expend the effort to come up with a good Rust crate bundling of Chromium or Gecko or etc that isn't tied into GTK. Yes, it would defeat the "just use the platform's webview instead of bundling" line, but really it would only be a concern for Linux.