6 ms·
Gooey: A GPU-accelerated UI framework for Zig
- noelwelsh 5mo agoInteresting 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!)
- vova_hn2 5mo 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 https://github.com/chriskiehl/Gooey
- ssernikk 5mo ago> how do I choose between Gooey and GPUI? GPUI is for rust, not zig
- mgrandl 5mo agoI mean GPUI is rust and Gooey is Zig so if you wanna do a project in Zig you probably wouldn’t choose GPUI.
- LouisvilleGeek 5mo agoCall it Ziggy
- shorsher 5mo agoGPUI is written in Rust, so in this specific case the decision is already somewhat made for you.
- torginus 5mo agoIf 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.
- WD-42 5mo agoThis 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.
- WD-42 5mo agoI take it back. This project is pure slop https://github.com/duanebester/gooey/blob/main/docs/architectural-cleanup-plan.md https://github.com/duanebester/gooey/blob/main/docs/architec...
- porphyra 5mo agoWell, the big CLAUDE.md there is a giveaway that it was AI generated: https://github.com/duanebester/gooey/blob/main/CLAUDE.md https://github.com/duanebester/gooey/blob/main/CLAUDE.md But still, the project solves a legit pain point. And the author seems pretty hands-on with steering the technical implementation details.
- cookiengineer 5mo agoSadface :-( (Author of Gooey [1], a GUI framework for WebASM in Go) [1] https://github.com/cookiengineer/gooey https://github.com/cookiengineer/gooey
- Findecanor 5mo agoI 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.
- noelwelsh 5mo agoI also have one [1]. It's a good name :-) [1]: https://github.com/creativescala/gooey https://github.com/creativescala/gooey
- persedes 5mo agonot the maintainer, but at first I thought it was python :D https://github.com/chriskiehl/Gooey https://github.com/chriskiehl/Gooey
- anitil 5mo agoI've always loved this project, I've used it a lot for making my scripts into internal tools for everyone in the team, even non-technical staff
- cookiengineer 5mo agoWe need to make a gooey family of UI frameworks!
- minraws 5mo agoooof I did have the nagging feeling I had seen a gui thing with that name before.
- amelius 5mo agoNice work but honestly I haven't seen convincing arguments for writing medium to large GUI applications in a language that has no automatic GC.
- ecshafer 5mo agoThis 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.
- coffeeaddict1 5mo agoThis 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 5mo agoThat 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.
- jetbalsa 5mo agoThats why I've always like pytk from tkinter import \* root = Tk() a = Label(root, text ="Hello World") a.pack() root.mainloop()
- cwillu 5mo agoFWIW, 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.
- kristoff_it 5mo agoAnother Zig GUI project that people might be interested in is DVUI: https://github.com/david-vanderson/dvui https://github.com/david-vanderson/dvui
- atmikemikeb 5mo agoDVUI is I think the most mature zig gui project, and a very good immediate-mode approach imo. Here's a recently released open source project built on DVUI in zig: https://fizzyed.it/ https://fizzyed.it/
- ErenayDev 5mo agoIt 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 5mo agoyep, 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.
- deleted 5mo ago[deleted]
- KolmogorovComp 5mo agoI 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.
- mawadev 5mo agoI have to say it: Zig devs are on another level
- porphyra 5mo agoIt was made with AI though: https://github.com/duanebester/gooey/blob/main/CLAUDE.md https://github.com/duanebester/gooey/blob/main/CLAUDE.md That said, it fills a legit hole in the ecosystem and the author seems to be hands-on with the technical direction.
- randypewick 5mo agoWhy? 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 5mo agoWhat giants do "we" stand on?
- randypewick 5mo agoMy question was genuine: what makes the Zig devs apart from the others, according to the question op? Arguably, there are important things that Zig devs are doing which are not "Zig dev made" (hence the "giants" I mentioned). NASA 10 rules are now rebranded as "tiger style" and marketed along Zig; Data Oriented Design existed before Zig; LLVM existed before Zig; the authors of gpui, the library that seems to have inspired gooey, apparently did a pretty great job (please correct me if I'm wrong, I don't do graphics, don't use gpui, this is what I understood when gpui came out). I'm sure Zig devs made pretty great things, too! Does Zig make them apart? Do Zig attracts more capable devs than other languages, maybe? Genuine question!
- Validark 5mo agoI take issue with the statement that "tiger style" is marketed along with Zig. Tiger Style is neither convention nor standard, it's not on ziglang.org, it's not referenced by the Zig Core Team as the end all be all. At present I don't recall them ever referencing it, but I'm sure they have talked about it somewhere. On the subject of Data-oriented design, it's mostly just the default way of thinking about software in most contexts. The DoD movement is not so much building on predecessors as it is ignoring predecessors who tell us to use OOP and "clean code" for everything. LLVM is the part of Zig that breaks the most, it's the slowest part of the compiler by leaps and bounds, and takes the most time of the core team to fix the constant breakages it introduces. I'm glad it exists obviously, to some extent, but I wouldn't praise it for much more than its widespread appeal and ease of "adding another pass" compared to GCC and having more of a company-friendly license. It could have been designed a lot better and could be managed very differently and we'd see better results. GPUI - I bet it's great. I guess I just tend to dislike phrasing like "stand on the shoulders of giants" because I tend to think the best thing hasn't been built yet. "Real engineering has never been tried!" I agree though that an AI port of a Rust library to Zig is probably not what any of us consider the holy grail of engineering. In short, I think Zig and TigerBeetle and the Handmade Ethos exist not primarily because others paved the way, but because others went astray. Andrew Kelley used to argue with people online about how cross-compilation should be easy for systems languages and got hit by the excuse parade every time. Eventually he decided to quit his day job and solve it himself. Is that standing on the shoulders of giants? I don't think so. Yes, he has technically picked up where others left off, but he's picking up on abject failures and fixing them. Now there is good engineering within LLVM and Clang, and good developers have done good work on it. I'm not saying everyone who worked on it is stupid or did bad work. However, there are glaring issues at a macro level and organizational level that individual contributors can't fix.
- jbritton 5mo agoI 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.
- Sakamitsu 5mo 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.
- henry_bone 5mo agoIt'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/architectural-cleanup-plan.md 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)
- danielvaughn 5mo agoTo 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 5mo agoYeah, 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 5mo agoI 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.
- AbuAssar 5mo agoCould have named it Zooey
- spartanatreyu 5mo agoSince it was spat out by an LLM, why not: Sloppy?
- nnevatie 5mo agoMore 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.
- Gerharddc 5mo agoAt 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 5mo agoZig still lacks a proper GUI framework that you can actually rely on.
- Gerharddc 5mo agoFair enough. I was referring to the GUI framework space in general, not specifically for Zig
- Simran-B 5mo agoIn what general direction would the innovation be? I'm not sure if it's actually needed - a lot of things have been tried and the paradigms that persisted you can choose between but it seems to be a matter of taste. I often feel that the real issue is the lack of maturity and stability. I rather want a complete UI toolkit including learning resources (not reference docs!), no matter how boring, instead of super clever implementation that is never in a usable state.
- mgerb 5mo agoImGui is reliable and Zig makes it trivial to use.
- sppfly 5mo agoMaybe 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.
- 1matin 5mo agoUsing 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.
- localhoster 5mo agoYavos - yet another vibe coded shit
- snarfy 5mo agoThis is great. Show me the GUI! We are gonna need more than a couple pics of chat-zig.
- deleted 5mo ago[deleted]