logoalt Hacker News

hendrikmans • today at 2:57 PM • 4 replies • view on HN

Electron being bad is a bit of a junior- to mid-level engineer tell in my eyes, the sort of thing you'd say if you've just learned that some apps use more RAM than others, maybe built a small Rust TUI and are now wondering why not everything is using Rust. Something you'd believe just before you learn what engineering trade-offs are.

So, yeah, enjoy rebuilding complete browsers, I guess? I'm sure they'll run more efficiently than the rendering engines that have been refined and tweaked over the course of now multiple decades.

Well, unless you leave out the annoying stuff, like a11y, IME, RTL, but who needs those things anyway, am I right.

Then you find out that iterating on a fully Rust-based app is sloooow, so you add a scripting layer, maybe integrate a little Lua VM or something that lets you execute JavaScript?

Congratulations. You've built a browser, just with fewer features, more bugs, and probably higher RAM usage. Good job.


Replies

vmg12 • today at 3:12 PM

Electron is bad, just because Rust is not a good language for building UIs doesn't make electron not bad. People that pick electron (and Rust / gpui) just completely ignore the entire host of other options that are available (I suspect because they want to avoid thinking).

➕ show 1 reply
the__alchemist • today at 3:25 PM

Could you please link to some GUI applications you've built in rust, and/or describe why you added those abstractions and built a browser? This doesn't match my experience.

➕ show 1 reply
delta_p_delta_x • today at 3:05 PM

> is a bit of a junior- to mid-level engineer tell in my eyes

There is absolutely no reason for Discord—a chat application—to run everything a browser does. Why do I need to play videos in the chat application? Why do individual avatars and even tags have to run custom shaders? It's called scope creep.

> a11y, IME, RTL

All of this can be done at the platform level. Win32 did this three decades ago. Comes with entire language packs.

> so you add a scripting layer, maybe integrate a little Lua VM or something that lets you execute JavaScript

See above: scope creep; features for features' sake.

➕ show 1 reply
post-it • today at 3:00 PM

> Then you find out that iterating on a fully Rust-based app is sloooow

Maybe not anymore. I don't work on any Chrome-sized Rust codebases so I don't know, but iterating on anything is so much faster that it might work out fine.

➕ show 1 reply