CUI – Native UI components for C
yappologistic.github.io
yappologistic.github.io
I don't want to discourage this kind of experimentation, but I also question how much of the last 20+ years of UI and C knowledge was not used in the construction of this project. Also, do I want to build a kanban board in C? Unsure.
Just take care when evaluating this for actual usage.
Do you think that this person is going to stick around and fix those issues, or just move on to the next impressive project in a week?
That was more or less the point I was trying to make. You can vibe-code your own variant of this project (as the poster I was replying to suggested) but you run into the same problem that you need many more iterations of refinement. If we think that everyone is simply going to vibe-code their own UI frameworks (or whatever) going forward then I think that is a wrong assumption. The nature of software development hasn't changed, just the speed at which we can produce it.
This is just a comment in general, not specific to the project posted by OP.
We have GPUI, we have web components, we have Clay UI. No one needs another C UI library.
Well, actually they do, but the LLM wouldn't know why. You gotta have used all these to figure it out, and then spend months wondering upon a better design, researching old experiments by random people in archived repos for inspiration. LLMs are useful only for that last part, quickly comprehending a strange repo you found from 15 years ago.
This is the kind of thing I can't understand. They're trying to solve a problem they don't have. Assuming other people might need it, without understanding anything about that domain.
There's a thing that people who are infatuated with AI can't understand: anybody else has the same power as you! The old entrepreneurship-like ideal of trying to create something new just for the sake of innovation doesn't work anymore. Innovate on something that solves a problem you have, for you. Otherwise it's just slop, introducing chaos to system, increasing internet entropy.
This is something I'm seeing more often... vibecoded is starting to mean somebody just delegated their thinking to AI and whatever AI spit they just shipped blindly.
I think this is quite different then what I'd call AI-assisted coding, in which the engineer is still in the reins and you can see, even if you see the tales of a lot of code in short time, that the code has actually been looked over and polished by a human.
There might be a place for vibecoded software where only the outcome matter and the code is soft of disposable, but a library or a framework doesn't seem to be the place for that.
The question is: if you're doing this same thing, but with LLMs as your "reports," is it vibe coding? The term was once an epithet, but I think it's expanded to refer to the technique of not living in an IDE, not the objective function.
If your objective function places an emphasis on maintainability: vibe coding can be a positive. If not: it can be a source of great pain. As with many things, it's the wielder, not the technique.
In the Apple world, Native usually means using the system UI components and the Apple guidelines.
Wouldn't "native ... for C" be redundant?
A good middle ground might be having platform-specific pieces but expressed using a more standard domain-specific language. E.g. technically you can already wire up GUIs without interface builder but it's quite verbose. There should be some simpler way to express layout constraints and have button callbacks.
Or some flag to ignore users that post these types of projects often.
It's not my project but I will definitely give the library a try.
Though, funnily enough, this kind of info and more is extremely easy to add to HN via a vibed extension. At this point, mine just stops HN from loading completely and constructs its own page (with a proper dark theme and the information I care about).
The reason for this is an effort asymmetry: casting upvotes is easy, and most people do it without much thought, whereas determining that something is spam or misinformation requires looking a lot more closely.
I did an experiment a couple weeks ago of having Opus 5.5 translate an MP3 decoder from Rust into Cortex-M33 assembly language, both raw asm and symbolasm. The code was 3x smaller and ~1.5x faster than Rust -O3. These seem like gains that are worth it.
I should add, part of the experiment was to test whether having variable names and (C style) types would help the LLM. For a task of this size (about 1.5 kLoC Rust, 3k insn asm) it was inconclusive, but for larger projects I suspect it would make a difference.
And the plan for symbolasm is to move past C style types into Rust style and maybe dependent typing, specifically to facilitate automated proofs.
An MP3 decoder for a single target doesn't really run into that complexity, a UI components library for (Linux, Windows, macOS) * (x86-64, ARM64) suddenly has a 6x multiplier on what was already something with waaay deeper dependencies and integrations than MP3.
At least that's what I've noticed vibing my DE without external libraries. It went really fast when the complexity was small because most of the work was in adding code. Then it started taking longer to build and test, even with optimized builds and tests, than it took for the AI to do its part.
Rust with no deps and a single compilation unit is already fast.
C has in fact been displaced in many places. Just because it survives in a few holdout contexts is a historical artifact more than a testament to the language.
The tools have gotten fancier, for sure, though.
For larger codebases, things might be different.
I'm really curious how secure C software would be if reviewed by AI and run exclusively in a WASM runtime.
EDIT: It's immediate mode.
Take the chips and rating as an example
https://yappologistic.github.io/CUI/#/c/chips-and-rating
It’s purely aesthetic as functionality (and ux) wise, chips are not different from checkbox with labels and rating is just a discrete slider.
And as I thought, you can see the duplicate code for switch and checkbox here.
https://github.com/yappologistic/CUI/blob/f1202e6d98cdc297f9...
People do need to differentiate between UX primitives and something that just looks different.
bool narrow = cui_viewport_size(ui).x < 760;
cui_row(ui, .width = CUI_FILL, .height = CUI_FILL, .align = CUI_ALIGN_STRETCH) {
if (!narrow) { sidebar(ui, s); cui_separator(ui); }
content(ui, s, narrow); /* a menu button opens the drawer when narrow */
}
cui_sheet(ui, "Menu", &s->drawer, .side = CUI_SIDE_LEFT, .size = 280) { nav(ui, s); }
There's a reason QT uses XML for their layouting, there's a reason people prefer Tauri + Vue/React, there's a reason Swift uses declarative paradigms in all their UI code. It's not that you can't build good UI frameworks in low-level languages; for example, I think Go's Fyne[1] is a pleasure to use. But people actually used their brains when designing that framework, as opposed to "hey Claude build a UI framework in C, make no mistakes."[1] https://fyne.io/
I would be more concerned about the opposite problem: the fact that it's apparently reactive and thus inherits the same performance pitfalls as every other reactive UI framework. Retained-mode UI is much uglier (at least if you build the UI in code) but doesn't have these issues.
edit: actually it's worse than reactive, it's full immediate-mode render-everything-every-frame.
The use of C, in that case, was likely made for performance reasons and avoiding dependencies.
The author added dozens of complex widgets in a few days, AI driven of course. The intended audience is not manual coders, you would show some examples to the clankers and ask for you UI and custom widgets.
You're on shaky ground using xml for ui layouts as posterchild for good developer ergonomics.
_sigh_
$ tree lab
lab
├── BUI
├── CUI
├── GPUI
└── TUII didn’t see the code here because I couldn’t find an easy link to its Github. My UI framework i’m calling FocalUI. We do layout and basic geometry with a fork Clay where we added “layer” and “focusable” markers to Clay elements. Instead of drawing immediate mode, we store a list of draw commands and layer geometry in a CoreAnimation-like tree. The renderer composits the layer tree and renders to OpenGL, and we use damage tracking to copy just the changed pixels from the GPU back to the camera’s framebuffer for scan-out.
It’s been a huge effort to add touch inertial scrolling, spring animation, navigation effects etc at 55hz to this device that before only did d-pad nav at 25 Hz, but things are starting to shape up for a release this week :)
Well, fewer problems!