GPUI is getting its own repository
211 points by EvilGoose 10 hours ago | 75 comments

sarojbelbase 5 minutes ago
I know this helps lots of people but very strange that it wasn't by default.
reply
drnick1 6 hours ago
The hello world code example reinforces my opinion that Rust is verbose and ugly.
reply
airstrike 4 hours ago
Rust is not to blame for that example. Here's the same example rewritten with iced:

    use iced::widget::{column, *};
    use iced::{Center, Color, Fill, Theme, border, color};

    fn main() -> iced::Result {
        iced::application(|| (), update, view)
            .window_size((500, 500))
            .run()
    }

    fn update(_: &mut (), _: ()) {}

    fn view(_: &()) -> impl Widget<()> {
        let swatch = |c: Color| {
            container("")
                .width(32)
                .height(32)
                .style(move |_| container::background(c))
        };
        let colors = [
            color!(0xff0000),
            color!(0x00ff00),
            color!(0x0000ff),
            color!(0xffff00),
            Color::BLACK,
            Color::WHITE,
        ];

        container(
            column![
                text("Hello, World!").size(20).color(Color::WHITE),
                row(colors.map(swatch)).spacing(8),
            ]
            .spacing(12)
            .align_x(Center),
        )
        .center(Fill)
        .style(panel)
    }

    fn panel(_: &Theme) -> container::Style {
        container::background(color!(0x505050)).border(border::color(color!(0x0000ff)).width(1))
    }
Also this is a pretty shit example because it's mostly showing styling... and in any sane app, you have a predefined theme

The typical GUI example is a counter

Syntax is rarely a reason to choose a language

If Rust feels "ugly" to you, may I suggest you consider how that comes from lack of familiarity, rather than an intrinsic shortcoming of the language?

reply
nicoburns 3 hours ago
With Dioxus Native:

    use dioxus::native::{Config, LogicalSize, WindowAttributes};
    use dioxus::prelude::*;

    fn main() {
        let window = WindowAttributes::default().with_surface_size(LogicalSize::new(500.0, 500.0));
        let config = Config::new().with_window_attributes(window);
        dioxus::native::launch_cfg(app, vec![], vec![Box::new(config)]);
    }

    fn app() -> Element {
        rsx! {
            Stylesheet { href: asset!("/assets/tailwind.css") }
            HelloWorld { text: "World" }
        }
    }

    #[component]
    fn HelloWorld(text: String) -> Element {
        rsx! {
            div { class: "flex flex-col gap-3 bg-[#505050] size-[500px] justify-center items-center shadow-lg border border-[#0000ff] text-xl text-white",
                "Hello, {text}!"
                div { class: "flex gap-2",
                    div { class: "size-8 bg-[red]" }
                    div { class: "size-8 bg-[lime]" }
                    div { class: "size-8 bg-[blue]" }
                    div { class: "size-8 bg-[yellow]" }
                    div { class: "size-8 bg-black" }
                    div { class: "size-8 bg-white" }
                }
            }
        }
    }
You can also use standard CSS if you prefer it over tailwind. And if you wanted to deduplicate, the 6 divs can be written in a loop like so:

    for color in ["red", "lime", "blue", "yellow", "black", "white"] {
        div { width: "32px", height: "32px", background_color: color }
    }
reply
hresvelgr 2 hours ago
I've been using Rust pre 1.0 and even though it has come leaps and bounds, it is a very ugly language. Where I will give credit though, it is consistently and uniformly ugly.
reply
BetterThanSober 18 minutes ago
> fn update(_: &mut (), _: ()) {}

> move |_| container::background(c)

There's no way anyone can see this and thinks it is legible

reply
stonogo 25 minutes ago
I'm pretty familiar with Rust at this point but I'll never look at something like

    fn view(_: &()) -> impl Widget<()> {
and think "nailed it"
reply
mixmastamyk 54 minutes ago
Nah still ugly, like C++ said hold my beer. ;-)
reply
cevn 6 hours ago
I think this is more of a function of the GPUI library being very powerful. If you just write "hello world" in rust that is a lot shorter.
reply
zamalek 4 hours ago
I love Rust, but my opinion is that linear types are extremely poorly suited for making UIs.
reply
speed_spread 3 hours ago
Rectangular types would obviously be more appropriate.
reply
csomar 5 hours ago
Or, there is a lot going on there and the library/Rust doesn't hide it from you. Your mileage will vary depending on which format you prefer and that's why I pick Rust.
reply
YuechenLi 4 hours ago
Idiomatic Rust seemed to always use a ton of method chaining much more than any other language, even TypeScript, so a lot of Rust code just reads like "names.iter().cloned().map(|name|name.trim().to_string()).filter(|name| name.is_empty()).map(|name| name.to_lowercase()).filter_map(...)" all the time.
reply
kelnos 56 minutes ago
You see this in functional programming languages. Personally, I prefer it, but I get that it's not for everyone.
reply
the__alchemist 4 hours ago
I've observed this too. I consider it more of a style (You did say idiomatic) or DSL than a core part of the language. I avoid it.
reply
vor_ 4 hours ago
I guess I'm used to it coming from Swift.
reply
bloppe 5 hours ago
Rust is ugly as a beginner, beautiful as an intermediate, and sorta ugly again as an expert.
reply
thousand_nights 6 hours ago
well, luckily we don't have to write the code ourselves anymore
reply
keyle 4 hours ago
I'm not sure what you mean... It's a beautiful dialect of Klingon.
reply
eddythompson80 5 hours ago
Who cares. You might as well be saying assembly is verbose and ugly. That is just the output of "create a hello world gpui app" prompt.
reply
chubs 4 hours ago
I've been blown away by how rich the gpui-kit componentry is: https://gpui-kit.com/component/ I recently wrote a Rust desktop app using iced, and now look at gpui[-kit] with envy ;)
reply
vinhnx 2 hours ago
I love GPUI and GPUI-Kit, I think what make GPUI attractive is the Kit components. I've been building the desktop apps around it and love the result so far: https://gpui-kit.com/apps/vtcode/
reply
giancarlostoro 8 hours ago
Finally, I have wanted to use it but felt awkward that it was inside the editors repo.
reply
scronkfinkle 4 hours ago
I don't really understand the negative views towards egui in this thread. It works great. In my spare time I've been building an open source little harness thing ( https://www.byob.chat/ ) as a fun side project and egui is an absolute blast when it comes to functionality. It so far has behaved as an open canvas, I can press F2, and click and drag any components on my native desktop app to rearrange them, I can also theme it with anything, including live shaders.
reply
echelon 4 hours ago
Heck yeah! Thank you so much, Zed team!

We're looking forward to using this at ArtCraft. We've already forked egui (and we're going to try to upstream our work). Even so, we find lots of things we cannot use egui for.

GPUI is essential for some of the work we're doing.

reply
bobajeff 48 minutes ago
I'm fascinated by the ArtCraft project. I'm curious how the project handles software architecture / design while using agents.
reply
okasaki 8 hours ago
> GUI

> No screenshots on web site, docs, or repo

reply
nixpulvis 7 hours ago
It's clearly not ported over yet...
reply
thrance 7 hours ago
I could have sworn I saw some kind of portfolio page not too long ago, with screenshots from different projects using gpui. Can't seem to find it anymore.
reply
jwstillwater 3 hours ago
Were you thinking of their awesome list for it maybe? I stumbled upon it browsing Zed’s repos and it’s full of happy tinkerers!

- https://github.com/zed-industries/awesome-gpui

reply
FrustratedMonky 3 hours ago
Exactly.

If you are posting a GUI product of any kind.

Put together a demo.

And then, put the link right at top where everyone can find it. Not buried in a help document on page 66.

I know they have one, i've seen it. Couldn't say how to find it again.

reply
yieldcrv 5 hours ago
it says a lot about who is involved to make it to the big year of 2026 with zero consideration that it would be useful to have these things

visual examples seen as an afterthought instead of a prerequisite

these are the people that cried ageism for the last 15 years not noticing their rejection was actually because they railed against javascript being used outside of jquery

Now they’ve finally found a way to skip from C++ straight to Rust for frontend work

hope the community picks it up and makes it more convincing and accessible, with visual aids

reply
rudedogg 8 hours ago
It would be better to call it zgpui, zed-gpui, or Dear GPUI.

I feel like naming a library after either GPUI/GPUGUI make talking about this technique difficult. And the technique didn’t originate in this library.

reply
nextaccountic 6 hours ago
But this isn't called gpugui. Gpui is a given name, it doesn't describe any specific technique
reply
slopinthebag 7 hours ago
i'm confused why gpui get's so much attention; it's not fast, it's not accessible, it's not ergonomic, and it's not beautiful. there are more mature options in the rust space. what gives?
reply
the__alchemist 4 hours ago
It's from a VC-funded company. I don't understand the mechanism, but VC-funded software tends to dominate in social media attention and online discussion when introduced.
reply
Buttons840 2 hours ago
I think it's because a project with funding is going to have progress and at least some community. If people are being paid to work on it, they probably have time and care to do things.

I don't know anything about <other_open_source_Rust_GUI>, but I expect the documentation to be half-baked, and if I look at the GitHub repo the most recent activity is going to be somebody who made a bug report 6 weeks ago and nobody has responded to it yet.

The team behind the software matters and a team with funding is appealing.

reply
FrustratedMonky 3 hours ago
Its because a VC is going to throw at least some money at marketing.

You'd be surprised what throwing just 1 or 2 people at marketing can do to get visibility.

Compared to just a group of engineers crunching out code.

The group of engineers might be building something great, but its just a tree falling the forest. Nobody hears it. You have to spend some time broadcasting it, making demo's, posting about it.

reply
tensor 3 hours ago
GPUI kit is the only UI framework that is accessible, actually. And it is fast. Beautiful is irrelevant as you can style it however you like. It can do nice smooth animations if you want too. There is also gpu-fast that fixes some important performance issues.

edit: Slint has good accessibility support too, but it's commercial for commercial projects.

reply
ogoffart 2 hours ago
Slint is free of charge for commercial desktop projects. Slint is under multiple licenses. The GPL makes it open source, the royalty free license makes it free of charge on desktop and mobile, only proprietary embedded projects need a commercial license.
reply
devilsdata 7 hours ago
What else would you recommend? egui?
reply
nicoburns 6 hours ago
Not the OP, but:

   1. egui (30.3M total / 9.2M last 90 days) (note: immediate mode)
      https://crates.io/crates/egui

   2. Iced (3.2M / 770k)
      https://crates.io/crates/iced

   3. Slint (2.4M / 955k) (note: GPL/commercial license)
      https://crates.io/crates/slint

   5. Dioxus Native (181k / 26k)
      https://crates.io/crates/dioxus-native

   6. Freya (49k / 12k)
      https://crates.io/crates/freya

   7. Floem (45k / 15k)
      https://crates.io/crates/floem

   8. Vizia (7k / 700)
      https://crates.io/crates/vizia
All of those options are technically superior to GPUI in my subjective opinion. GPUI focusses pretty narrowly on Zed's use case, and suffers from severe NIH syndrome (so has put a bunch of time and effort into building things that already exist as crates in the Rust ecosystem).

GPUI does have a pretty nice component library. And of course an excellent code editing control. And it's... fine. But I wouldn't choose it over the other options.

reply
Klonoar 6 hours ago
> GPUI does have a pretty nice component library.

This is why people are flocking to it. Nothing else really matters.

reply
nicoburns 6 hours ago
I disagree that nothing else matters. But I do agree that this is why people are flocking to it.
reply
aloha2436 4 hours ago
Yes, nothing else matters _for adoption_, compare React.
reply
slopinthebag 4 hours ago
react doesn't have a native component lib
reply
Klonoar 2 hours ago
The GPUI components lib isn't from the original authors of GPUI. It was a third party thing by Longbridge that's since grown.
reply
bkvanmeter 6 hours ago
If you're looking to target web in addition to native platforms (GPU-accelerated), try Refract. Supports pre-rendering and hydration, enabling the initial view of applications to be served via SSR / bundled.

https://refract.rs https://crates.io/crates/refract https://refract.rs/examples/chat

reply
int0x29 4 hours ago
How many of those have any compatibility with OS accessibility APIs? GPUI appears to have some support natively which is more than a lot of native Rust UI frameworks.
reply
bendangelo 6 hours ago
Iced has a lot of limitations. Just look at their roadmap. For example it doesn’t support text highlighting but maybe it does now.
reply
katdork 6 hours ago
halloy uses iced and i can select text in halloy just fine...
reply
Klonoar 5 hours ago
halloy custom built that, it's not part of iced proper - or at least it hasn't been historically.

There was some rumblings PR-wise of it becoming a thing but I don't know offhand if it went anywhere.

reply
Buttons840 2 hours ago
Iced, one of the top Rust GUIs, has a little less than 10 pages of documentation--that's it, that's ALL of it.

In the past month 1 person has made commits.

What does it matter if it's superior?

Actually, AI has come into existence since I last looked at it, so maybe docs aren't needed anymore?

reply
mixmastamyk 39 minutes ago
I thought it was less. Page one is dedicated to “expect nothing,” as well.
reply
katdork 6 hours ago
egui is probably worse technically (advocating for its use is like advocating for people to write their applications with imgui; it's good for game dev uis but please don't otherwise). iced is probably the best there?
reply
jensen_the_whit 5 hours ago
this kind of comment is such a meme at this point. imgui is perfectly fine for applications other than game debug menus. same with egui and other immediate mode ui frameworks. better, in fact, when you look at the state of pretty much every user interface written in a "proper, reactive ui library"
reply
ksec 5 hours ago
I have been trying to submit NSH on to HN. It is still early days but worth checking out.

https://nsh.dev/

reply
hmokiguess 7 hours ago
can you share those options? curious about your take
reply
slopinthebag 7 hours ago
egui is the most mature, has built in accessibility, and is quite ergonomic and flexible. iced is a good alternative, it’s used for cosmic desktop and is a good option if you don’t want an imgui. if you’re happy with the trade off of using a web view, dioxus is really good - you still build the ui in native rust (not wasm) and the web view is used purely for rendering so that negates some of the cons of something like tauri (no ipc mechanisms required), and you get the rendering and accessibility of the web.

honourable mention to slint, seems mature and good but I’ve never personally used it.

reply
tensor 3 hours ago
egui is immediate mode. That rules it out for reasonable performance for complex apps.
reply
Klonoar 6 hours ago
Cosmic runs a fork of iced, not iced proper.
reply
socalgal2 6 hours ago
egui is designed for english only game dev tools. It is not remotely mature for actual tools that support CJK, IMEs, and accessibility
reply
jensen_the_whit 5 hours ago
egui is not designed for english only game dev tools.

you can make it work for whatever usecase you want. that's the beauty of oss.

reply
rubyn00bie 5 hours ago
There is accessibility, but it’s not fully baked. I’m currently building something with it, using Claude and Deepseek, and one of my requirements was accessibility… I forget the specifics, it’s either missing references in the docs or on main. Either way, Claude found it and I told Claude it would have to implement anything missing. It took about a week, and used my entire quota that week, but everything seems to be good at this point.

Thus far, it has also been quite fast hitting my performance targets which were also quite aggressive. The only real issue I’ve had is memory usage is higher than I’d like but it’s still 1/3rd of what I’d get if I was using Electron… and if I’m remembering right it’s mostly because of the driver stack.

I need to figure out what I plan on doing with the app when this first version is finished: open sourcing it, charging for it, or some combination of the two. Though I can’t imagine not trying to upstream or release the accessibility work.

reply
nixosbestos 8 hours ago
Wasn't it once a separate repo, then they vendored it, and there's a community fork? I wonder what will happen with it?

ref: https://gpui-ce.github.io/

edit: lmao downvotes for this? what even is this community anymore?

reply
Ciantic 8 hours ago
It was not maintained, there was also "gpui-kit" and "gpui-unofficial" which builds on the official repo. [1] Nobody will mourn for community fork. Having one official repo brings so much clarity.

[1]: https://github.com/iamnbutler/gpuikit, https://github.com/gpui-archipelago/gpui-unofficial

reply
nixosbestos 7 hours ago
Yeah, it's definitely a signal, too. I'm excited.
reply
yedpodtrzitko 7 hours ago
there's also https://github.com/longbridge/gpui-fast which seems to be pretty active. I wonder if they'll upstream their changes.
reply
slopinthebag 7 hours ago
it's not just this community, it seems like it's the entire internet. everyone is either ragebating or butthurt. i cannot imagine what goes through someone's head to downvote your comment - i imagine mostly nothing.
reply
bmitc 5 hours ago
Haven't they said this before and just a few weeks or a month later pulled the plug on that?
reply
Ray-D-Song 6 hours ago
[dead]
reply
bkvanmeter 6 hours ago
[dead]
reply
throwaway69123 7 hours ago
The licence makes using it pretty useless, I wonder if they will change stance on this. Context https://github.com/zed-industries/zed/blob/main/crates/ui/LI... the ui elements themselves are under a really restrictive licence.
reply
kelnos 49 minutes ago
Useless for corporations, sure. Open source projects can use it just fine.
reply
nextaccountic 6 hours ago
I'm eager for a GPL resurgence in libraries. Copyleft is the opposite of restrictive
reply
ethin 3 hours ago
I very much disagree. Not everyone wants to be forced to give their source code to the world, which is what GPLing your library does. Use the MPL if you want that -- at least then the virus-ish nature of the GPL is contained to your library and doesn't force your ideals onto everyone else. This is, IMO, particularly bad for libraries like this one where the ones that are accessible with assistive technology are very limited.
reply