Repository navigation
A native desktop client in Rust (GPUI), as an alternative to the Electron shell #32012
phillip-hirsch
started this conversation in
Ideas
Replies: 3 comments 3 replies
|
@phillip-hirsch Did you try https://www.gpuix.dev before rewrite client parts into rust? |
3 replies
|
Update: I picked up another $200 Claude sub so now the large-feature round is done, and the branch has been through a full review.
Still left:
I've refreshed the branch linked in the post above, The questions in the original post still stand. |
0 replies
|
solid work. rust for accelerated desktop apps , particularly as a result of Zed (editor) very performant. here's something similiar i did in rust, and using the same ecosystem: https://github.com/davidbuzz/MissionPlannerRust |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I rewrote the T3 Code desktop client as a native Rust app built on GPUI (via gpui-kit). It talks to the same
apps/serverover the same WebSocket contracts, unchanged. I'd like to know whether you want any part of this upstream, and in what form, before I open a PR. CONTRIBUTING asks for that agreement first.What it is
apps/desktop-gpui, one binary (t3-desktop). It starts and supervises the bundled server the way the Electron main process does (same backoff, same exit-code handling) and connects to saved and remote environments the same way.t3code://handoff, single instance and keychain credentials.unsafein the crate (#![forbid(unsafe_code)]). Three GPUI crates are vendored from crates.io with small patches: a safe setter, two bug fixes and one small addition (textarea decorations).Numbers
Same machine, same seeded database, same server bundle (Nightly
0.1.10-nightly.20261111) for both apps, each in its own scratch profile. "Client" excludes the server process. Medians of 5 runs per app, measured November 11.Windows 11, i7-8700K (12 threads), 32 GB, 144 Hz display:
macOS, MacBook Pro M3 Pro, 36 GB:
The GPUI app runs the server on the system Node, and Electron runs it on its bundled one, so server memory differs: 289 vs 246 MB on Windows, 344 vs 252 MB on macOS. On macOS, GPUI's server also found the installed CLI providers and Electron's didn't. The GPUI binary includes the Office document viewer and isn't stripped yet.
Correction: the first version of this post gave GPUI's idle CPU on Windows as 0.2%. In most of those runs the display had gone to sleep, which stops GPUI's repaint loop. With the display on it was about 1.5%, because GPUI's Windows layer woke on every display refresh even when nothing changed. A patch now pauses idle windows the way GPUI already does on macOS, which gives the 0.05% above.
What's missing
t3code://registration in an installer yet.The cost
This is a second implementation of the client UI. Every change to
apps/webthat a desktop user can see needs a matching change in Rust, or the two drift. I've kept up with two upstream merges so far: about 25 client-visible PRs ported in one day, then a smaller batch of 10, of which 5 needed changes. Each port was checked against the web code it mirrors. So it's doable, but it's ongoing work, and it touches the "hit every surface" rule in AGENTS.md: desktop would no longer get web changes for free.Questions
main: the vendored crates, crate setup, icons, core logic (shell, server supervision, model), pages, and the workspace UI. I can split it further any way you prefer.The code is on a public branch if you want to look before answering: https://github.com/phillip-hirsch/t3code/tree/feat/desktop-gpui/apps/desktop-gpui
All reactions