Live data from Hacker News

Show HN: I rewrote my Mac Electron app in Rust

desktopdocs.com

171–180 of 465 posts

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

#171

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?

Or alternatively, why would SQLite be not as performant as Redis in embedded context?

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

#172
post #75

Earlier quoted context omitted.

It's not a new or scary thing, but it's way more expensive (in time or money) than relying on "it looks good on my machine, so it looks good everywhere." I've worked on large consumer-facing web-apps where we had a dedicated QA team (and/or contracting firm) that runs visual regression testing on multiple platforms and browser versions. As a solo developer, I have no interest in being that team for my hobby project.…

> "it looks good on my machine, so it looks good everywhere." It bas always been a fallacy though, as with CSS the end result can depend on the DPI scaling and the size of the display (unless you make sure it doesn't, but then you need to test different setups to be sure).

Well, they're right to point out that it removes a lot of inconsistency though. For example, today I was working on an app which used some Unicode characters as icons in buttons, and they look perfectly centered in the button in Firefox but weirdly off-Center in Chrome.

I never managed to find a set of CSS properties which made it look good in Chrome tho. And if it was a more serious project I'd probably have used SVGs instead of Unicode characters.

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

#173
Great work, I can imagine how interesting the migration went. Why are you using Redis if I may ask? Was something like sqlite not enough? What are your biggest challenges with Tauri?

I also work with an Electron app and we also do local embeddings and most of the CPU intensive work happens in nodejs addons written in Rust and using Neon (https://neon-rs.dev very grateful for this lib). This is a nice balance for us.

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

#174
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 developers building web apps for web browsers typically do not test cross browser compatibility.

They build in Chrome and test with Chrome and then the test of the week they whine about Firefox and Safari.

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

#175
post #71

Earlier quoted context omitted.

Do you mean the actual rendering of html/css when you say rendering differences? Or are you referring more to differences in JS support?

Pure html/css rendering. JS support could be addressed trivially in the build system by transpiling anything unsupported by the oldest likely target.

Not all JS APIs are fully pollyfillable, especially ones that are part of the Web platform rather than ECMAScript. I dunno if it's a bigger problem overall than HTML/CSS, probably not, but it's not consistently trivial.

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

#176
post #172

Earlier quoted context omitted.

> "it looks good on my machine, so it looks good everywhere." It bas always been a fallacy though, as with CSS the end result can depend on the DPI scaling and the size of the display (unless you make sure it doesn't, but then you need to test different setups to be sure).

Well, they're right to point out that it removes a lot of inconsistency though. For example, today I was working on an app which used some Unicode characters as icons in buttons, and they look perfectly centered in the button in Firefox but weirdly off-Center in Chrome. I never managed to find a set of CSS properties which made it look good in Chrome tho. And if it was a more serious project I'd probably have used SV…

Sure, the closer your config is from the actual user config the fewer issues you'll get, but I wanted to highlight that even with electron you ought to test on different configurations.

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

#177
post #85

Earlier quoted context omitted.

> Reading anecdata on forums, it seems like the only people who get up in arms over an extra 200MB are HN readers, and my app isn't really targeted at them I think it's good to be wary of overly sensitive advice that regular users don't care about. But would a regular user realize they have 10 electron apps running and their ram is maxed out all the time? The argument against Electron isn't just a single bloated bina…

That's a fair point. My app (and possibly the OP's) is built assuming it is the user's current focus and priority, and that you'll quit it once you're done with the task. I don't feel bad about asking for a chunk of RAM for a focal app like this, but I would feel differently if I was shipping a background tool or small utility or something.

Especially macOS is built on the assumption that you rarely "quit" apps. When you close all of an app's windows, it remains running. You actually have to hit cmd+q or right click and hit "Quit" in the Dock to really quit an app.

In other circumstances too though, it's not great UX to demand your users quit your app once they're done with it because it eats too many resources just being idle in the background. It's an issue I have with both Electron, where idle apps waste tonnes or RAM, and with many Rust UI frameworks, where an immediate-mode architecture means they'll be consuming CPU on the background.

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

#178

Earlier quoted context omitted.

Tauri does not do this in all cases, as WebkitGTK on Linux has performance issues and is often the ugly duckling of everything. I also feel like I will have to, yet again, trot out the comment from a Slack dev that explains why they moved _from_ per-platform webviews to Chromium. This isn't new ground being charted, plenty of companies and teams have been down this path and Electron exists for a reason. (I am not say…

According to https://slack.engineering/building-hybrid-applications-with-... , Slack never used multiple different per-platform webviews. The earliest version of their desktop app was Mac-only and used the OS-native WebView API, but they switched to Electron at the same time they started work on making the app cross-platform. At the time, not only did Tauri not exist, but neither did the WebView2 API that it uses und…

Isn't Spotify using CEF (Chromium Embedded Framework) rather than Electron?

Regardless, your point stands: it's a bundled Chromium on all platforms

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

#180
post #151
post #105

It's sad to witness how much suffering developers are ready to endure (and make their users suffer) just not to part ways with HTML/CSS/JS stack. The stack that was never designed properly, let alone for modern UI apps. Flutter would be much better choice for such a desktop app, for example.

wxWidgets or QtWidgets if you want a proper desktop GUI app.

Heck, Tcl/Tk could work as well.
Post reply on HN