CUI – Native UI components for C yappologistic.github.io · 77 points · 45 commen...

@best

CUI – Native UI components for C yappologistic.github.io · 77 points · 45 comments · HN thread

TL;DR CUI is a new open-source UI component library written in C, offering a set of ready-made controls (buttons, checkboxes, switches, chips, rating, node editor, sheets, and more) with examples and a showcase, targeting desktop and web. The project is an immediate-mode, reactive-style framework whose first commit was about four days before the post, and its code was written largely by an AI agent.

  • Provides a catalogue of widgets with a documentation guide, component showcase, sample apps and a changelog.
  • Uses immediate-mode rendering: the entire UI is re-rendered every frame, which one commenter verified from the code.
  • Currently runs on desktop and web; the maintainer says mobile ports are expected.
  • The first commit is about four days old and the code was written almost entirely by Claude, according to commenters.
  • Several commenters found that some widgets differ mainly in appearance (chips vs. checkboxes, rating as a discrete slider) and that code is duplicated between switch and checkbox.
  • Widget id generation was called naive by one commenter, and the node editor was reported as janky on mobile.

Discussion The thread is split between admiration for how polished the library looks and skepticism about its origins and design. Many commenters point out that it was vibecoded in days and resembles ShadCN, and they question whether a C UI toolkit serves a real need when AI can generate one on demand. Others defend the project as an experiment or argue that the critiques miss the target audience, which they think is AI-driven users rather than hand coders. Several side debates appear: whether 'native' is the right word for a custom-drawn toolkit, whether C is a sensible choice given memory-safety concerns, and whether the CUI acronym clashes with Controlled Unclassified Information. The mood is mixed, with praise for the look and a skeptical undercurrent.

  • Looks polished and appealing, a good lightweight alternative to Electron (many): Several commenters praise the visual quality and the small footprint compared with 300MB Electron apps, saying it is a pleasant way to make a small UI app.
  • Vibecoded and derivative; little real UI or C expertise evident (many): Many argue the project was generated by an AI in days, resembles ShadCN, and reflects no grounding in decades of UI framework design or C practice.
  • Questions the value of such libraries when AI can generate them on demand (some): Some say that if an LLM can produce a bespoke UI kit quickly, a dependency on a generic library adds little value and adds maintenance risk.
  • Code is readable and the API is acceptable (some): A commenter who read the sample code found it clear, though noisier than SwiftUI because of repeated prefixes.
  • Immediate-mode and reactive design has performance pitfalls (a few): One commenter notes that the framework re-renders everything each frame and suggests retained-mode UI would avoid some performance issues.
  • C is inherently unsafe and should not be promoted (a few): One commenter argues all C code should be replaced, while an embedded developer replied that lack of an MMU makes some problems less relevant.
  • The acronym collides with Controlled Unclassified Information (a few): Several commenters joke about or criticize the name because CUI is a US government term for Controlled Unclassified Information.

Links from the comments

#Cui #CLibrary #UIToolkit #ImmediateMode #AICodeGeneration #NativeUI