Discord is ditching Electron and its new app uses less RAM

96 points - today at 1:05 PM

Source

Comments

kayson today at 2:45 PM
I'm very interested in (and a total novice in) cross platform GUI application development. Hadn't heard of GPUI, though I had heard of Tauri. I looked at the GPUI front page and saw this mess of almost-CSS method chaining... Surely there's a better way? This seems horrible to me.

> div() .flex() .flex_col() .gap_3() .bg(rgb(0x505050)) .size(px(500.0)) .justify_center() .items_center() .shadow_lg() .border_1() .border_color(rgb(0x0000ff)) .text_xl() .text_color(rgb(0xffffff)) .child(format!("Hello, {}!", &self.text)) .child( div() .flex() .gap_2() .child(div().size_8().bg(gpui::red())) .child(div().size_8().bg(gpui::green())) .child(div().size_8().bg(gpui::blue())) .child(div().size_8().bg(gpui::yellow())) .child(div().size_8().bg(gpui::black())) .child(div().size_8().bg(gpui::white())), )

Insanity today at 1:57 PM
Maybe the good thing to come out of the RAM crisis is that engineers will care about memory usage again lol.
Kuyawa today at 2:15 PM
The app size also went from 10 GB to 10 MB, start time went from 10 secs to 10 ms

Goodbye Electron, we barely knew you

Telaneo today at 2:14 PM
Holy Jesus of Nazareth. I love it.

I just pray that Vencord will continue to work in some form, if only so I can use whatever font I want. I'm not a fan of many other changes they've made and I've thus had to reverse, but I'm willing to trade away the flexibility of CSS for an app that uses 5 times less RAM. Even better if it doesn't go away at all, but we'll see.

PreciousH today at 2:15 PM
It's crazy how much RAM electron needs, at my old startup the main product was an electron app, i initially used to run into this issue where AI wouldn't clean up the dev builds it spunned up for e2e testing and each could be over 500MB, it just get's to a point that the cross platform advantage is no longer worth it, i think it was one of the main reasons cursor had to move off electron to rust based builds.
mintflow today at 2:16 PM
I noticed this news and because one of my codex banked reset is expiring soon

I launch codex with astra+ultra on my tauri project because webview sometimes cause blank screen on user device to let it to rewrite the tauri projec to GPUI

It did those stuffs for me

- get rid of the CGO and MINGW toolchain for cross building windows on Linux

- wrote a compatbility layer to communicate the original app backend written using rust

- Achieve not ideal but acceptable UI/UX as the tauri project

- The new build using 24MB memory which is quite good and I do not even bother to check the tauri version

It amazing time to rewrite, though I still can't remember joy of old days that manual coding, but my lower back ask me to just embrace the Agentic coding...

resters today at 2:48 PM
discord's electron app was a study in bloatware, quite unlike nearly all other electron apps I've used.
krystalgamer today at 2:38 PM
If I understand correctly, they're ditching Electron but still using React but with their custom renderer.
Daedren today at 2:07 PM
I've never used GPUI. Does GPUI provide the same assurances of accessibility? Of proper CJK rendering?

Activities will apparently still use Tauri. Is that going to be a compatibility nightmare due to WebKit? (At least until CEF comes out)

Venn1 today at 2:05 PM
The Linux desktop client was using a bit more memory than I expected. 1326 MB from a cold start, and I'm only in 11 servers.
throwaway2046 today at 2:21 PM
smolder today at 2:14 PM
There was already an electron-free native client for discord some years back, but they interfered with it. At this point, there's nothing at all impressive about this. It's not hard to ask AI to "RIIR" as has been shown many times. However, I am glad that building stuff on electron might finally be seen as lazy and wasteful.
Swiffy0 today at 2:09 PM
Not sure what to think of this.

Sure, a Rust implementation will perform better and use less RAM, but it's quite obvious that the transition to Rust will be done almost entirely by AI.

Don't get me wrong, the AI coded Rust version of Discord will most likely work just fine. The thing I'm wondering about is if it's a good idea to rewrite your whole codebase (which I assume is handwritten since Discord predates AI coding) with AI because now there is nobody that knows how it really works - I'm wondering what's the value of having a human-written codebase + the people who wrote it. Just feels like one shouldn't throw that into the trash like it's nothing?

lookeey today at 2:26 PM
asow92 today at 2:40 PM
Asking in good faith: In the agentic age why use abstractions like Electron at all? Shouldn't we write apps in lower-level system languages like Rust like Discord has done?
paxy today at 2:46 PM
We are at a point where the "port this to rust, make no mistakes" meme is basically a reality.
nonethewiser today at 2:28 PM
It doesn't say but it's likely a direct product of AI.
musha68k today at 2:41 PM
[delayed]
dist-epoch today at 2:31 PM
As the motto says, "you can just do things"

Such a rewrite would have been unthinkable 2 years ago, but now it's table stakes.

greatquux today at 2:32 PM
DO TEAMS NEXT
pipe01 today at 2:08 PM
RIP mods
Kuyawa today at 2:21 PM
"To continue reading *blah blah* *barfs* Verge subscription" WTF???

15 years reading the verge without subscription. What happened?

deleted today at 1:10 PM
acdev_app today at 2:50 PM
[dead]
eastbound today at 1:59 PM
That's a direct benefit from AI.

If all products ditch Electron, it satisfies the NSA requirements of having AI-generated backdoors on your computer, while allowing you to reduce your RAM consumption and letting this precious silicon for Sam Altman (He's quoted saying RAM is better spent in data centers than in personal computers - and in an era where everything is Cloud, one might wonder why the base Macbook Pro has 32GB).

elevaet today at 2:45 PM
Hopefully we will get an Electron-free VSCode too at some point.

edit: there is one https://github.com/Sidenai/sidex haven't tried it yet