Discord 正在放弃 Electron,其新应用占用更少的 RAM
Discord is ditching Electron and its new app uses less RAM

原始链接: https://www.theverge.com/news/1027379/discord-ditching-electron-web-app

Discord 正在用 Rust 替代 Electron 作为其桌面应用,以获得更好的性能和内存安全。CTO Stanislav Vishnevskiy 表示,Discord 的许多基础设施和客户端代码已经使用 Rust,而完整的客户端迁移还将移除 React Native,移动端将保留原生 UI,同时通过 Rust 共享应用代码。预览版显示 Windows 客户端使用 290MB RAM,而当前应用为 1GB 或更多。发布进度尚不清楚,但 Discord 希望很快开始用户测试。

Hacker News 用户讨论 Discord 正在脱离 Electron 的报道,声称应用体积和启动时间大幅降低。评论者对“从 10GB 降到 10MB”这类数字是否准确展开争论,指出 Electron 会打包完整浏览器,且 Discord 的 Linux 客户端已使用超过 1GB 内存。有些人将内存危机视为优化原生应用的动力,并希望仍能保留模组。其他人注意到原生重写可能借助 AI,引发对失去对代码库的人工理解的担忧,而有些人认为广泛的系统知识已足够。一名用户描述用 Codex 将 Tauri 项目重写为 GPUI,减少内存使用。评论还提到 Vencord 兼容性、GPUI 的无障碍/CJK 渲染,以及 Discord 的活动可能仍使用 Tauri。总体而言,反应在更低资源消耗的热情与对 AI 驱动重写及可扩展性损失的怀疑之间交织。
相关文章

原文

Discord is finally giving up on Electron, the cross-platform framework that lets developers build desktop apps using web technologies. Electron web apps are notoriously heavy on system resources, and Discord is now moving its desktop app fully to Rust — a modern programming language designed for speed 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.”

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.”

联系我们 contact @ memedata.com