Discord Is Ditching Electron For Rust 74
Discord is replacing Electron with a desktop client built fully in Rust, which the company says should significantly reduce the app's notoriously high resource usage while improving performance and memory safety. "We've been early adopters of Rust since 2018 and a lot of our infra, voice tech, and even some of the current client is already Rust, the holy grail was getting the whole client there," explains Discord chief technology officer Stanislav Vishnevskiy in a post on X. "That means Electron goes away, and so does React Native, mobile keeps native UI but shares app code with desktop via Rust." The Verge reports: Vishnevskiy also shared an image of the Discord Windows client using just 290MB of RAM, which is a clear improvement as you only have to participate in a few servers and RAM usage can easily hit 1GB or more using the current Windows app. It's not clear when Discord will make the full switch over to Rust, but Vishnevskiy says the company "hope to get it into testing with users soon."
just 290MB of RAM (Score:3)
Just? For fucking what?
Re: (Score:2)
99% of it is memory usage of a mile high stack of shit that the app is built on that none of the developers know or care about. Modern software. Can they even justify 1MB of memory usage?
Re:just 290MB of RAM (Score:4, Insightful)
It's hard to display a .webp image without allocating 5-50MB of RAM. Depending on resolution, encoding, etc. Given that Discord is ultimately a meme delivery system, 290 MB seems cheap.
Re: (Score:2)
I think they want to have 290 MB before loading the first image.
Re: (Score:2)
Sorry, wrong moderation. Had to undo.
Re: (Score:2)
I could accept 1MB for audio buffers. But the heap of junk and tech debt that "modern" stuff comes with is really insane. Time to really slow down making new stuff and clean up the mess. If we still can.
Re: (Score:2)
Electron bundles a copy of Chromium and NodeJS inside every application and it's not unusual for one PC to be running more than 1 instance of Electron, sometimes more than FIVE.
Re: (Score:2)
Electron bundles a copy of Chromium and NodeJS inside every application and it's not unusual for one PC to be running more than 1 instance of Electron, sometimes more than FIVE.
Um... this 290MB was for the Rust based client. No Electron there.
Re: (Score:2)
it's a lot but still better than the 1-2GB the Electron-based Discord client uses even when mostly idle
Re: (Score:2)
(just 290MB of RAM) For fucking what?
(you) Electron bundles a copy of Chromium and NodeJS inside every application ...
(me) 290MB was for the Rust based client. No Electron there.
(you) ...but still better than the 1-2GB the Electron-based...
Sorry, but I don't follow what point you're trying to make. Is the 290MB justified because it includes Electron and thus Chromium and NodeJS as well? ... it doesn't include that stuff, so I guess not. WTF is the justification for the 290MB? Just that it's an improvement over the other implementation? That still doesn't explain what it is that's adding up to 290MB of memory usage.
FWIW, though that seems quite high still, it's not all that surprising. I'd still be curious to know what the big culprits are, bu
Re: (Score:2)
here's what Google AI said & the conclusion is the release version could use more RAM if it's at feature parity with the current Electron app
"Even though the Rust rewrite completely eliminates the massive web-browser wrapper (Electron), ~290 MB is still considered a "heavy" baseline for a chat app because Rust only changes how the code runs, not what data the app has to process.
The remaining memory footprint is driven by what Discord is doing behind the scenes:
1. In-Memory Server and Channel Caches
Re: (Score:2)
Re:just 290MB of RAM (Score:5, Funny)
-- Sam Altman, 2026
Re:just 290MB of RAM (Score:5, Informative)
1920x1080 24bit bitmap is over 6MB in size by itself. That's assuming the rendering target is a single flat surface with no back-buffering, and also not multiple layered sub-windows. Yeah, believe it or not, but painting things to the screen, just a flat window, still requires RAM using modern compositors. Now add memory allocation for fonts, glyphs, the logo, all the menuing/config sub-windows, and it adds up quite quickly.
In the Win9x era, the only reason things didnt use this scale of RAM is because there was no compositor. Back then, you painted directly to video RAM, every and every single draw call. There was no persistence of individual window bitmaps, only raw draws to the final output framebuffer.
And this is all just accounting for the main application, not counting the server content which is undoubtedly loaded with people sharing meme gifs 24/7.
Re: (Score:1)
Exactly. If we used the hardware as it is actually meant to be used, then there would be zero waste.
Re: just 290MB of RAM (Score:2)
Oxygen is plant shit.
You're soaking in it.
Re: just 290MB of RAM (Score:2)
Nice smooth window drags and resizes without tearing is pretty great though.
Re: (Score:2)
Exactly. If we used the hardware as it is actually meant to be used, then there would be zero waste.
Along with not a lot of everything else. Writing directly to video memory may reduce RAM usage but doesn't necessarily lead to the fastest end user experience. There's a reason we introduced first buffering, then double buffering, then compositors, and it is not because someone thought "hey, let's just waste ram for the LULZ" . The "waste" is not doing clever things with available hardware. Use of RAM to accelerate of smoothen user experiences is clever (but loading an entire web framework to display a wind
Re: (Score:2)
Plotters could handle it back then.
Re: (Score:2)
Re: (Score:2)
The first hard drive I ever owned couldn't hold that.
Re: (Score:2)
I think the first hard drive I used was 20MB, but it could have been smaller. And that was the claimed size, not what was really available.
Re: (Score:2)
Re: (Score:2)
I agree, that's insane. Why bother switching from Electron in that case? I've seen Atom and VSCode use less memory.
This is an IM client with some nice rich text features, emojis, and pictures/movie support. There's no reason for it to take more memory than 2000s era Microsoft Word.
Re: (Score:2)
Atom was an appalling memory hog. I was always mystified as to why everyone abandoned the superb sublime text and its tiny footprint for a giant wrapped webpage that seemed custom built for making peoples computers chug.
On the upside, the day Atom was released, people stopped having the "bloat" excuse to not try Emacs anymore.
Re: (Score:2)
I don't understand it either. I mean, yes, right now I'm using VSCode, Atom's bastard brother with similar issues, but this is mostly because if I want anything approaching support for a generic web development environment it's the only thing on the table. The entire industry took one look at VSCode and said "Good enough, who cares about RAM anyway?" and... well, that's our industry. Before that it was Eclipse. Eclipse isn't even a good IDE, it has the most obnoxious autocomplete I've ever seen, but somehow
Good (Score:3)
All forms of React are hot garbage.
Re: Good (Score:2)
Mod Parent waaay TF up.
This is definitely due to AI (Score:3)
I've grown to be okay with Rust (Score:1)
I no longer consider it ugly. I mean, I write python, too. You know, the language where whitespace is significant. A thing that even COBOL dropped in the 1980s because it was a terrible idea.
Re:I've grown to be okay with Rust (Score:5, Insightful)
Re: I've grown to be okay with Rust (Score:3, Interesting)
Instead we get to have holy wars over whether or not it's appropriate to have a language where if the indents get screwed up the code is completely ruined, and can't be fixed by simply running it through fmt(1).
I've actually had this happen when copying Python examples from a webpage. I decided to use perl instead at that very moment.
Re: (Score:2)
Instead we get to have holy wars over whether or not it's appropriate to have a language where if the indents get screwed up the code is completely ruined, and can't be fixed by simply running it through fmt(1).
It's not appropriate. Anything that is better is useless for corporate work [zerobugsan...faster.net].
Worse is better. Falsehood is freedom. Truth is terror. Python is
Re: (Score:2)
Well, if you have a situation where anything adds or removes other chars, your code breaks as well. The problem is not Python, but a skill issue with understanding whitespace. I would be wary of any code on the web where somebody managed to screw up publishing Python code.
The whole thing is really pretty much a non-issue. Sure, in the case you describe, the person posting the code crewed up, but that does not mean the tool is bad.
Incidentally. Python is 1st on TIOBE at the moment, with almost 2x the rating
Re: (Score:2)
The whole thing is really pretty much a non-issue. Sure, in the case you describe, the person posting the code crewed up, but that does not mean the tool is bad.
I don't know where the screwup was. I think it was with the website actually, doing something tricky with CSS to display the code nicely. It doesn't actually matter who didn't do the thing that they would have had to do though, it's a fundamental error in the creation of the language. This is literally going back to an aspect of punch cards.
Incidentally. Python is 1st on TIOBE at the moment, with almost 2x the rating of place 2 (C). That is not what a fundamentally broken tool gets.
The appeal to popularity is a logical fallacy.
Re: (Score:2)
Ah, yes... stupid ideas aren't stupid because they force you to do things the "right way".
Too bad nobody can agree on what the right way is.
Re: (Score:2)
Unless you're writing in a text editor where you have to manage the whitespace yourself, almost any IDE will take care of it for you automatically.
It doesn't. If you try to paste code, the IDE gets confused, which doesn't happen with braces.
prevents the kind of holy war being waged to this day and wastes everyone's time when it winds up getting discussed or argued over yet again.
It doesn't. You're a moron, an idiot, and a heretic for liking syntactically significant whitespace. You are the worst kind of person. Trump probably likes whitespace. If you care so much about color, you're probably racist.
Re: (Score:2)
I know a programmer with a vision disability (brain not eyes) who cannot write in Python only and explicitly because of the whitespace thing.
Languages with braces are zero problem.
This makes a programmer ineligible for a large number of jobs on the market.
I've offered to write a preprocessor to allow braces if it ever became a deal breaker for a job.
The second biggest problem with disabilities is when an implementer makes a decision having no idea that decision is unworkable for a disabled person.
The ultima
Re: (Score:2)
I know a programmer with a vision disability (brain not eyes) who cannot write in Python only and explicitly because of the whitespace thing.
Languages with braces are zero problem.
At the risk of sounding argumentative, I'm very curious how that's a thing. I might even try to look up that issue to see if there's an essay on it or something.
First thing that came to mind for me is: :retab) Retab to intelligently convert space indents to tabs, change tabstop to something sufficiently large enough,
1. my editor can highlight all whitespace in another color. That would make those indents stand out like a sore thumb.
2. one can "retab" a file to adjust the amount of whitespace. (see also: vim
Re: (Score:2)
I have no idea why people consider whitespace carrying semantics terrible. Sure, you have to be aware of it, but then it is just a minor thing.
All this criticism just shows how mentally inflexible many "coders" actually are.
Incidentally, I do not use an IDE for my Python coding. Whitespace is still not a problem.
Re: (Score:2)
What's going to happen to the web version though? It's all Javascript.
Re: This is definitely due to AI (Score:2)
Rust compiled to wasm, maybe?
Re: (Score:2)
Could be. The current implementation is rather heavy.
Re: (Score:2)
Rust compiled to wasm should give pretty good results. That is if the Rust libraries are set-up for it. Would be a bit surprising if they were not at this time.
Re: (Score:2)
Some friends of mine were doing this sort of thing (split development) years ago, pre AI. They had a desktop client in C++ and JS client for the web, which was slow. They compiled the core of the C++ one into ASM.js (this dates it) and it ran a lot faster. After a while they scrapped the pure JS one.
Re: (Score:2)
I was thinking they might try something like that. Hopefully it works.
Re: (Score:2)
Interpreted languages fall down when complex stuff is not available via libraries that run natively. One of the main reasons for wasm in browsers.
Re: (Score:2)
I wouldn't call 290 MB amazing.
I know, however, the one time I did launch Discord ... I immediately quit and deleted it and never tried again. It was so slow and clunky, I felt dirty for days after.
You keep using that word. I don't think it means w (Score:2)
Re: (Score:2)
"Rust is the language slop is written in"
Re: (Score:2)
Re: (Score:2)
No, it's not just Rust. Rust and a bunch of other languages. Plenty of slop is being produced in JS and many others.
Re: (Score:3)
Wel... If people insist on AI generating slop I would prefer that slop is in Rust. The Rust language is so fussy about types, object lifetimes etc the clankers have to iterate on its to even get it to compile. It has to be higher quality slop.
Re: (Score:2)
That is, writing C with an LLM is basically guaranteeing that you'll have insecure code. Not in the least because much of the sample code has bugs in it.
Re: (Score:2)
Re: Vibes from the PHB (Score:2)
If you ever decide to not be an asshole boss/manager, this book is waiting for you [amazon.com]. Go with God.
Re: (Score:2)
Do these IRC clients support persistent chat history, file drops, and link summary bots? Because those are among the major features that Discord, Slack, and the like offer compared to IRC. I'm aware that a set of protocol extensions collectively known as "IRCv3" exist, but what sub-64K clients support them? And what public servers offer them?
RUST and what GUI ? (Score:4, Interesting)
RUST is generic programming language. Electron is a "webbrowser in a box". So apples and oranges. So what GUI toolking they used. (No I will not fall down this low to RTFA). The 290MB memory footprint still suggest they use HTML/JS there just in a rusting box?
Re: (Score:2)
So what GUI toolking they used.
Vishnevskiy has said they are using GPUI [gpui.rs] which is from the same group that created the Zed text editor. Though it is quite new and still pre-1.0, so it's interesting that they've chosen that for their client.
Does anybody know what the GUI ... (Score:2)
... layer is? Is it FOSS? Is it cross platform? Ditching a web layer for something native is a good idea, even better when Rust is the main PL, but I'd really like to know what stack exactly they're using and if it's running a FOSS cross platform GUI. Can someone enlighten me?
Re: (Score:2)
Re: (Score:3)
The end of modifications? (Score:3)
Does this spell the end of Discord modifications? This is concerning because Discord put very little effort into the Linux version and naturally the community stepped up and built mods that allow simple things like sharing audio and removing unwanted UI elements. I doubt they'll be opening any of this rust code.
Re: (Score:2)
Today a LLM decompiles you the whole program in a day. Adding some modifications are probably no issue.
Just have to chime in (Score:2)
It could be written in assembly, be ultra-fast, use 60kb, never crash or have a security hole, and i would
STILL HATE DISCORD. Giant privacy, maintenance and centralization nightmare.
That's like saying (Score:2)