Gooey: A GPU-accelerated UI framework for Zig

175 pointsposted 16 hours ago
by ksec

67 Comments

henry_bone

9 hours ago

It's not particularly revelatory to point out that this project has been generated largely by LLM (claude most likely, given the CLAUDE.md in the repo).

Also looks like a bit of introspection has happened ... https://github.com/duanebester/gooey/blob/main/docs/architec...

I wonder if this is just what we get now: low quality code, expressed rapidly. We are excited by the promise only to be disappointed by the reality of the implementation.

There are still a few new things around that are carefully and thoughtfully developed and put out into the world. zig itself. MitchellH's ghostty. And there's still all the older foundations of really wonderful, robust, software created by people like Linus Torvalds and couple of generations of open source devs, that applied great skill, ingenuity and hard work to produce the very best software.

But I fear that I'm in for a period of lamentation as we get wave after wave of promising sounding developments, but where the reality is low quality, LLM generated crap that you really shouldn't use if you want secure, stable performant, production-ready software.

Seems like perhaps we've been through a golden age of really great software and that now it's coming to a close.

(edited to fix spelling)

Aurornis

8 hours ago

We're in the messy transition period where our old indicators of a promising GitHub project are too easily replicated by someone letting Claude Code run for a few days.

A year ago it would have taken someone months of nights and weekends effort to get this much code up and running. That person would have developed a good intuition for the architecture and where it should go.

Now Codex or Claude can bang it out in a couple days. You can try to have it do spec documents, code reviews, and cleanup passes but with today's tools these projects reach a point where it's just a swirling mess of pieces duct taped together in a way that passes tests. In my experiments, you quickly reach a point where the usable context depth (which is less than the 1M limits) keeps overflowing before you can get usable refactors in, and you're just going in circles. I know it's theoretically possible to avoid these problems, but in practice you get spaghetti projects like this.

elcritch

2 hours ago

I don’t know, GPT-5.5 has been very effective for me. It’s not perfect but the quality of refactoring it can do is awesome.

Previous models both GPT and Claude would struggle with the larger picture more. Pretty quickly they’d do one off hacks. Eventually they’d code themselves into a wall if you weren’t careful.

Haven’t hit that wall with GPT-5.5 yet. New changes or improvements on a GUI library I’m building seem to be constant in time per feature.

Though I’m talking only 10k’s of LOC. Also I’m using Nim which is both strongly typed and concise.

danielvaughn

8 hours ago

To be fair, "excited by the promise only to be disappointed by the reality of the implementation" describes ~95% of my experiences with all software over the last 20 years. In fact only a few exceptions really come to mind - git, treesitter, ffmpeg, and sqlite.

henry_bone

7 hours ago

Yeah, maybe it's rose coloured glasses on my behalf. Those examples you mentioned, I would 100% agree with. It's some of the best software out there. And yeah, there's probably always been rubbish about.

I guess I hope that the good stuff keeps coming and the dross falls away. More signal, less noise.

danielvaughn

7 hours ago

I do agree with you though. It feels like the industry has steadily been getting worse, AI is just like pouring kerosine on the fire. I'm almost embarrassed to call myself a software engineer now.

On a small bright note, I've gotten AI to help me produce some of my best work over the last couple of months. It may enable sloppy behavior, but it doesn't require it. I have hope that serious work will win out in the end, and that sheer human effort is still the differentiator.

henry_bone

4 hours ago

Yeah, there was a good article on here the other day where the author suggested going slower with AI and using it to help produce higher quality output. I think the idea is to be quite "hands on", coding much in the old way, but to use AI to help with, for example, test coverage, error mode detection and handling, refinement of the solution/feature, etc.

At least that's how I read it. :-) I'm learning that there's a place for the LLM but it's the sandpaper, not the chisel.

Pxtl

3 hours ago

Hah, that describes my relationship with git itself, actually.

mwcampbell

5 hours ago

Have you found evidence that the code is actually low-quality, or is that just an assumption based on the fact that it's evidently largely LLM-generated?

lelandbatey

5 hours ago

You should read the link they provided which goes into detail on the architectural shortfalls of Gooey due to an accelerated development.

dimator

3 hours ago

Tbh, the link itself sounds like LLM as well, spotted a few emojis in there. I suppose I could be wrong, but I feel like we're all getting good at sniffing generated language.

sppfly

an hour ago

Maybe I'm wrong, but I'm really skeptical about projects like this. 200000 lines of code addition in 3 months, basically 2000 lines per day. I don't think any human brain is capable to handle such cognitive complexity, unless the code is all plain data get/setters, which any framework is certainly not. For me a good way to use LLM is to learn how to build something big by writing a tiny one with it. But this only gives a shallow understanding of a big system. For any critical complex system you want to maintain for a long time, LLM is in no way a good choice.

ecshafer

12 hours ago

This looks good. But the thing that always lets me down on UI frameworks is how much freaking work it is to get something on the screen. My first language was Borland Turbo C++. It was so comparatively simple to do stuff. If I want to write a circle on the screen its just this:

#include <graphics.h> #include <conio.h>

int main() { int gd = DETECT, gm;

    initgraph(&gd, &gm, "C:\\TURBOC3\\BGI");

    circle(320, 240, 100);

    getch();
    closegraph();

    return 0;
}

Making some shapes and forms wasn't that much work either.

If I think back to VB and Windows (whatever it was then) making a basic window, form and some buttons was so simple and easy, they even made GUI builders because they were so good.

Somewhere along the lines GUIs became overly complex to implement.

WD-42

12 hours ago

OK, but what about actually using a GUI toolkit to make an actual application?

You can optimize a library to make it comparatively simple to draw a circle on a screen. But that tells me nothing about binding state, signals, styling, widget hierarchy, etc. Maybe these frameworks look complicated to you because doing something more than drawing a circle is actually more complicated.

cwillu

11 hours ago

VB was used to create a great many data-munging applications in its time, and while they were never pretty, they were lightning fast, largely consistent, and generally far more reliable than what we currently have.

monster_truck

8 hours ago

A relative's business has been and is still completely driven by a VB app. It's goddamn ugly but most businesses of their size in that industry have been paid subscribers for 30? years at this point. Most notably its the only piece of software they've never had to ask me for help with at all.

The only updates it gets anymore are little data packs when laws/regulations change and it seems like they automated that because it's always ready before it's needed. The last "big" update was a guide to running it in parallels on new macs.

chii

an hour ago

And that is the perfect piece of software - it does exactly what is asked, and no more. It has simple enough "architecture" to let anyone maintain it (by adding new stuff that regulations demand, easily), and continues to function without modification otherwise.

hombre_fatal

11 hours ago

Agreed. I want a coherent, deliberate architecture for building an application and managing state.

That's the hard part. I'll take on incidental boilerplate (e.g. Elm) if the architecture helps me build and understand applications. Whatever gets me to that latter part.

lll-o-lll

12 hours ago

So VB6 or earlier is what you are probably remembering, and VB has a fascinating history as it started life as a wysiwyg design tool before it was attached to any language.

However, you need to remember that these simpler tools were a product of a much simpler set of requirements. Fixed themes, fixed screen size, fixed aspect ratios. I imagine a wysiwyg editor that gives you all the power of, say, CSS, and yet remains simple for simple things, sounds like a much more difficult task. I haven’t worked on UI in 20 years, so maybe such tools do exist.

chii

an hour ago

> a wysiwyg editor that gives you all the power of, say, CSS, and yet remains simple for simple things, sounds like a much more difficult task.

so the problem is CSS isnt it?

The constraints and flexibility of CSS makes it difficult to make a simple outcome easy to specify in similarly easy CSS.

coffeeaddict1

12 hours ago

This is what you can with Qt:

    #include <QApplication>
    #include <QWidget>
    #include <QPainter>

    class widget : public QWidget {
    void paintEvent(QPaintEvent*) override {
        QPainter(this).drawEllipse(QPoint(320, 240), 100, 100);
    }
    };

    int main(int argc, char *argv[]) {
        QApplication app(argc, argv);
        widget w;
        w.resize(640, 480);
        w.show();
        return app.exec();
    }

It doesn't seem too complicated to me.

ecshafer

12 hours ago

That doesn't seem too bad, I agree. Maybe that's why QT is used. I haven't really used QT, but the more modern Windows apis, vulkan, etc all are pretty complicated.

cwillu

11 hours ago

FWIW, vulkan is not a GUI library; if you're reaching for it without a clear understanding of why you're doing so, yeah, it'll seem like a very complicated way of doing things.

nnevatie

4 hours ago

Yeah, it doesn't look too bad on the surface. However, Qt is bad and I'd advice moving away from it if you can. This is based on ~20 years of experience using it in various projects.

The licensing is trying to paint a picture of LGPL being somehow uncertain/evil, the way Qt advocates non-idiomatic C++ practices - I could go on for days, but shall digress.

TheRoque

9 hours ago

Vulkan is a graphics API, not a UI library or framework. It's way lower level and if your goal is to make a user interface, you're not really supposed to do it with Vulkan (but you could i guess)

jetbalsa

11 hours ago

Thats why I've always like pytk

    from tkinter import \*

    root = Tk()
    a = Label(root, text ="Hello World")
    a.pack()

    root.mainloop()

monster_truck

8 hours ago

100% Agreed. My first language was LibertyBASIC. It had everything a kid could want to make a paint program that had (at the time) more features than MSPaint, or whatever little game. Menu bars, undo/redo, dialogue windows, panes, sprites, sound, etc.

Compared to the effort:quality of something like tkinter, LibertyBASIC put it to shame! Not to throw shade, tkinter is perfectly fine but I don't think I would have cared for it at that age.

It also taught me how to pirate software, when I found out the borland compiler required to make .exe's I could give my friends was $200 :)

danielvaughn

6 hours ago

I know I must be underthinking this, but I really don't know why native toolkits can't just implement some codegen thing that takes XML and produces the above.

Like, all of that should be expressable with just

  <graph>
    <circle />
  </graph>

Gerharddc

2 hours ago

At first I was very excited about this project. After reading the comments, I'm now deeply saddened by it... Given how much competition there already is in the GUI framework space, it's very difficult to see why something hastily thrown together by AI would get much traction. To really make an impact in this space, I think we'll need to see something thoughtfully designed that really tries to innovate in some profound way rather than just being more of the same

1matin

an hour ago

Zig still lacks a proper GUI framework that you can actually rely on.

1matin

an hour ago

Using an AI-generated GUI framework written in Zig (a lang with no safety guarantees despite being quite helpful to human devs) is a brave decision.

noelwelsh

14 hours ago

Interesting project, but needs documentation. In particular, what's the model it uses? I.e. how are events, state, etc. handled? Normally I'd just work it out from the code examples, but the example in the README is over 200 lines which is too long for me.

(Don't tell me here. Make your docs better, so everyone benefits!)

WD-42

13 hours ago

This is great, we need more of this. It's high time we began to escape the dark ages of rule-by-Electron. See Bitwarden's recent fumble of a redesign.

KolmogorovComp

11 hours ago

I was really eager to use those new frameworks until a recent HN comment raising how power-hungry and wasetul these were for most of their usage (terminal, forms, tui), and now I think it will probably be seen as ‘bloat’ in the future.

Erenay09

12 hours ago

It is great to see the Zig ecosystem growing, even though it was achieved by AI. I wish humans had done it, but I do not wanna start a debate between those who arent fans of AI and those who are.

john_alan

12 hours ago

yep, dripping in AI.

It's a real problem, so many projects are adding features at breakneck speed, but with so many bugs and so little understanding.

Maybe that's just how it all works now, but I don't like it.

nnevatie

4 hours ago

More visual examples are sorely needed - I could only find a small (toy) example of a dialog, that didn't seem to showcase many of the framework capabilities.

jbritton

10 hours ago

I wasn’t clear from the description if text rendering is GPU accelerated, or in my case drawing quads from an atlas of characters in a texture is probably more efficient.

vova_hn2

14 hours ago

> Inspiration

> GPUI - Zed's GPU UI framework

Cool, but a comparison would also be very helpful.

If I decide to make a GUI app with Zig, how do I choose between Gooey and GPUI?

So far, all I know that GPUI is more mature and has at least one successful project built with it, so...

Also:

> Gooey: Turn (almost) any Python 3 Console Program into a GUI application with one line

> https://github.com/chriskiehl/Gooey

shorsher

14 hours ago

GPUI is written in Rust, so in this specific case the decision is already somewhat made for you.

torginus

13 hours ago

If I remember correctly, Zed's framework didn't set the goal of being able to draw arbitrary graphics/UI and by constraining that, it basically managed to represent everything with quads and distance fields in shaders, which reduced draw calls and GPU state management to a minimum.

ssernikk

14 hours ago

> how do I choose between Gooey and GPUI?

GPUI is for rust, not zig

mgrandl

14 hours ago

I mean GPUI is rust and Gooey is Zig so if you wanna do a project in Zig you probably wouldn’t choose GPUI.

cookiengineer

13 hours ago

Sadface :-(

(Author of Gooey [1], a GUI framework for WebASM in Go)

[1] https://github.com/cookiengineer/gooey

Findecanor

12 hours ago

I have also found a UI framework in C++ with OpenGL named Gooey (2008-ish).

And in early 2000, I was in a mailing list for designing a successor/replacement to X11, code-named "Gooey" that never went anywhere.

minraws

10 hours ago

ooof I did have the nagging feeling I had seen a gui thing with that name before.

AbuAssar

9 hours ago

Could have named it Zooey

spartanatreyu

8 hours ago

Since it was spat out by an LLM, why not: Sloppy?

Sakamitsu

10 hours ago

"Rewrite GPUI in Zig and make no mistakes" ahh moment. I will never trust software that is written by people who don't understand anything and just generate slop. You have a powerful tool that can help you understand how things work and improve your skills. You can explore huge codebases and find exactly what you're looking for without wasting hours digging through code. Instead, you choose to generate ai slop.

mawadev

11 hours ago

I have to say it: Zig devs are on another level

randypewick

10 hours ago

Why? This was AI-made and inspired to Zed editor GUI toolkit, egui, so it's mostly a derived work.

What's so special about Zig dev that puts them aside from the giants they stand on?

Validark

3 hours ago

What giants do "we" stand on?

amelius

13 hours ago

Nice work but honestly I haven't seen convincing arguments for writing medium to large GUI applications in a language that has no automatic GC.