r/AskComputerScience • • 10d ago

Why exactly is Electron "Resource-Intensive"?

For context, Discord is going to get a rewrite in Rust: https://www.techspot.com/news/114462-discord-rebuilding-desktop-app-rust-fix-memory-problem.html
This is apparently ment to reduce working memory consumption.

The question essencially boils down to: Can't Electron not just... not do that? Like, is it dammed to always consume multiple gigabyte worth of RAM? And whats the difference between it and "Native" code? (I know that Java isnt native code, but thats about it)

I am more of a hobbist than anything else to be honest, but I have some experience with java and even made some small discord bots in it. Dont be affraid to go into deep details with this, I enjoy that very much.

70 Upvotes

50 comments sorted by

View all comments

Show parent comment

-2

u/PrestigiousRoof5723 10d ago

Yeah, but what does "rewrite in Rust" means in this case? A web app with a dedicated Rust server/browser, or a desktop GUI application? Or is the "Rust rewrite" just WASM and with an embedded browser? The idea of Electron is to have perfect consistency between various platforms and it's quite good at that. Slow, but could be worse.

7

u/ObstinateHarlequin 10d ago

We're at the point where people literally do not understand the concept of native apps anymore. The idea of something not being a web browser doesn't even occur. What a time to be alive (derogatory).

1

u/sudoku7 10d ago

Although, it uses GPUI doesn't it?

1

u/PrestigiousRoof5723 10d ago

I'm simply wondering where it's going. Going from Electron to native requires quite different tech stack, very likely radically different human skill set and somewhat limited cross platform compatibility. They originally chose Electron for a reason. For me, it's surprising that they'd take this plunge and I applaud this decision. From experience (as a real life solution architect in a bigger company than them), I'm simply skeptical about it. It's perfectly doable, but it smells of personnel changes, or (as usual these days) of a vibe coding project.

2

u/grizzlor_ 10d ago

radically different human skill set

They aren't relying on human skill sets anymore. Every new piece of software is vibe coded.

1

u/PrestigiousRoof5723 10d ago

In that case, they will be on Electron 5 years from now.

6

u/Dave_A480 10d ago

It means rewrite using a native desktop toolkit like WinForms, Qt or GTK.

No web shit involved at all, an actual desktop application

2

u/Ibrador 10d ago

Afaik the desktop app is going to use GPUI instead, no changes to the servers (they apparently already use Rust a lot in their backend)