Live data from Hacker News

Show HN: I rewrote my Mac Electron app in Rust

desktopdocs.com

251–260 of 465 posts

Re: Show HN: I rewrote my Mac Electron app in Rust

#251

”but the app was almost 1GB " I mean, I knew Electron was heavy, but holy cow that is HEAVY. No wonder that despite CPUs getting fast and RAM being 10x the size it used to be that software keeps feeling slower than ever. So you weren't talking RAM size, you were talking the size of the app itself? 1GB? That used to be the size for AAA games.

Yeah, we were talking about the app itself, it was way too big when we first started.

Re: Show HN: I rewrote my Mac Electron app in Rust

#252

Earlier quoted context omitted.

There's also the simple fact that shipping an identical UI on multiple operating systems is obviously wrong for a least some of those operating systems (and maybe all of them). You don't have to worry about "platform intricacies" because a web-based cross-platform UI toolkit is going to get really basic UI conventions wrong.

At this point people are more accustomed to chrome’s conventions than the native UI’s conventions in most cases

But there aren't really many "Chrome conventions" to speak of. Every web app (and Electron app) necessarily has to reinvent a lot of wheels that desktop apps get for free from the underlying OS. And sure, there are component libraries for that... way too many libraries, each of them doing everything slightly differently from others.

Re: Show HN: I rewrote my Mac Electron app in Rust

#253
post #14

I recently went the other way (started a project in Tauri, moved to Electron) because of frustration with rendering differences between the web views employed on different platforms. Have you run into any cross platform UI bugs since you switched? It looks like your UI needs are pretty simple while computation is complex so the extra QA tradeoff would still be worth it for you. I'm just wondering if my experience was…

We are using system webviews for https://kreya.app (not Tauri, but a custom implementation) and the platform differences are seldom a problem... Polyfills fix most of the things and we are running automated end to end test on Linux, which catches most of the issues. IMO the most difficult thing is figuring out how far the users are behind with their webview version, mostly on Linux and macOS. Windows has done thinga…

On the contrary it is a big big issue if you have a complex web app like we do. It was a PITA to deal with user bugs in a specific macos version with a 8y out of date webview.

And the performances of webkitgtk are horrible on Linux.

Re: Show HN: I rewrote my Mac Electron app in Rust

#254
post #14

I recently went the other way (started a project in Tauri, moved to Electron) because of frustration with rendering differences between the web views employed on different platforms. Have you run into any cross platform UI bugs since you switched? It looks like your UI needs are pretty simple while computation is complex so the extra QA tradeoff would still be worth it for you. I'm just wondering if my experience was…

I am a web developer and haven't used Tauri or Electron much yet. I am wondering why rendering differences between different platforms are such an issue? When building web apps, you face the same challenges, so I would assume it wouldn't be much different.

Web apps pretty much by definition don't do the kinds of things that desktop apps want to do. In the rare cases where they are actually on par feature-wise, it's just as much headache to support all the browsers in use, it's just that the functionality bar is so much lower on average.

Re: Show HN: I rewrote my Mac Electron app in Rust

#255

Earlier quoted context omitted.

We actually haven't rolled out cross platform support yet with the Tauri version, so we will see how that goes. Our UI needs are simple, luckily. What kind of rendering differences were you seeing with Tauri? Was there one platform that worked the best/worst for your app? We'd love to support Windows next. With the Electron version of the app, we had issues running our bundled binaries on Macs with Intel chip. That c…

> I recently went the other way (started a project in Tauri, moved to Electron) because of frustration with rendering differences between the web views employed on different platforms. This is our #1 frustration with Tauri. The OS-provided system webviews are not stable, repeatable, consistent platforms to build upon. Tauri decided that a key selling point of their platform was that Tauri builds won't bundle a browse…

Haven't touched Tauri because of the cross platform issues. The major appeal with Electron to me is the exact control over the browser. I'm curious about Rust integration though. I'm guessing they're doing something that provides better DX over something like https://github.com/napi-rs/napi-rs?

Re: Show HN: I rewrote my Mac Electron app in Rust

#256
post #14

I recently went the other way (started a project in Tauri, moved to Electron) because of frustration with rendering differences between the web views employed on different platforms. Have you run into any cross platform UI bugs since you switched? It looks like your UI needs are pretty simple while computation is complex so the extra QA tradeoff would still be worth it for you. I'm just wondering if my experience was…

We are using system webviews for https://kreya.app (not Tauri, but a custom implementation) and the platform differences are seldom a problem... Polyfills fix most of the things and we are running automated end to end test on Linux, which catches most of the issues. IMO the most difficult thing is figuring out how far the users are behind with their webview version, mostly on Linux and macOS. Windows has done thinga…

Yeah I was wondering how you dealing with the inconsistency of the different webviews? Are you using jquery? Or data star? Or is your own custom made polyfill depending on your user base?

TBH, a lite weight polyfill for most system webview would be refreshing change to all the spa frameworks out there.

Re: Show HN: I rewrote my Mac Electron app in Rust

#257

Why embed Redis ? What feature do you need from Redis so bad that you need to embed it? Maybe you could just use Rust and have something performant without adding complexity?

Their vector search modules are the reason I embedded it. I tried sqlite and wasn't getting good search results with the vss extension. Maybe I wasn't configuring it correctly. Redis was just better than the alternatives (qdrant, sqlite, duckdb with vector search).

Are you using Flat indexes? If so they should return the same results provided you are using the same distance function. If you aren't using Flat indexes, there might be more setup, but I'd recommend just using Flat indexes. They are plenty fast on most systems for searching ~1 million vectors (assuming 1024-32 bit float vectors).

If you aren't doing anything crazy you could probably just get away with storing them all in a memory mapped file.

Re: Show HN: I rewrote my Mac Electron app in Rust

#258

Earlier quoted context omitted.

What is the difference between Tauri and Electron. From what I understand both use browser for rendering, except electron ships the whole browser while Tauri use the browser already there on the system.

That's part of it, but also Tauri uses Rust on the backend while Electron uses Node. Electron is way more mature with a larger developer community, but Tauri keeps gaining momentum. If memory safety, bundle size, and performance are important to you, Tauri is a nice choice. Electron is not bad but there's a reason there are so many new players.

> If memory safety

But Tauri is just a wrapper around WebKit, which is written mostly in C++.

Re: Show HN: I rewrote my Mac Electron app in Rust

#259

Earlier quoted context omitted.

> I recently went the other way (started a project in Tauri, moved to Electron) because of frustration with rendering differences between the web views employed on different platforms. This is our #1 frustration with Tauri. The OS-provided system webviews are not stable, repeatable, consistent platforms to build upon. Tauri decided that a key selling point of their platform was that Tauri builds won't bundle a browse…

Haven't touched Tauri because of the cross platform issues. The major appeal with Electron to me is the exact control over the browser. I'm curious about Rust integration though. I'm guessing they're doing something that provides better DX over something like https://github.com/napi-rs/napi-rs ?

> Haven't touched Tauri because of the cross platform issues.

You were wise. That's the biggest issue plaguing the project right now.

> curious about Rust integration though

Tauri is written in 100% native Rust, so you write Rust for the entire application backend. It's like a framework. You write eventing and handlers and whatever other logic you want in Rust and cross-talk to your JavaScript/TypeScript frontend.

It feels great working in Rust, but the webviews kill it. They're inferior browsers and super unlike one another.

If Tauri swapped OS webviews for Chromium, they'd have a proper Electron competitor on their hands.

Post reply on HN