CUI – Native UI components for C

(yappologistic.github.io)

64 points | by hilti 1 hour ago

13 comments

  • nepthar 25 minutes ago
    Okay, so this is cool, but also vibecoded by someone who just does frontend. I totally support AI development, but the first commit was 4 days ago and it's entirely written by claude. The UI looks like "the style that that AI comes up with" turned into a C framework.

    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.

    • mgdev 19 minutes ago
      Some projects are worth it just for the rebrand.
  • piker 41 minutes ago
    C increasingly makes sense for compile times if you can have a separate Fable pass on memory safety, etc.
    • nateb2022 33 minutes ago
      Assembly is increasingly making sense for compile times if you can have a separate Fable pass on code correctness, etc.
      • piker 23 minutes ago
        I think you’re kidding, but wouldn’t you have to maintain different code bases for each platform? C compiler gets you everywhere and WASM.
        • genxy 10 minutes ago
          Once you have Wasm, it gets you everywhere and the best path to Wasm is Rust.
          • arbll 5 minutes ago
            Funny in a thread that started with `increasingly makes sense for compile times`
        • raphlinus 17 minutes ago
          Yes, and? As the cost of code generation approaches zero, this starts to make more sense, especially if you do have mechanisms in place to ensure safety and correctness.

          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.

          • piker 9 minutes ago
            Yes that makes sense, but if you're iterating on software then I think C will generally win due to its ability to compile cross-platform until you want to build a "release" which you could do by having Fable translate it to ASM at that point.
          • genxy 8 minutes ago
            Did you have it go directly to asm or emit the assembly from the Rust toolchain and then contract that? For small stuff, I have been having it write directly, or larger pieces I am having better results via contractions.
        • linkdd 17 minutes ago
          Just ask the slop machine to translate the binary to every platform.
  • zerr 14 minutes ago
    More like custom UI components. Native would have been if you had wrapped e.g. Cocoa NSButton on macOS and Microsoft.UI.Xaml.Controls.Button on WinUI.
    • stephc_int13 0 minutes ago
      Native is one of those words that means different things depending on context and your background. For me, native means actual binary code running on the machine, not through a JVM or V8 or anything of the sort.

      In the Apple world, Native usually means using the system UI components and the Apple guidelines.

  • huhtenberg 10 minutes ago
    Any pre-built examples? Even if it's something like a calculator.
  • wg0 47 minutes ago
    Looks like ShadCN. That too in C. It's really really elegant.

    EDIT: It's immediate mode.

  • Luke2642 9 minutes ago
    Looks great, but node editor is janky on mobile.
  • saidnooneever 1 hour ago
    this looks really sweet actually. didnt dig into the backing code yet but the examples look really nice and clean to implement a UI with. well done.
  • CrzyLngPwd 20 minutes ago
    Looks lovely, but without long term support and hostory, I wouldn't touch it with someone else's long stick.
  • zerr 20 minutes ago
    Can you please prompt your agent to generate a C++ binding?
  • annoyingnoob 16 minutes ago
    CUI - Controlled Unclassified Information.
  • skydhash 35 minutes ago
    This looks like built by someone raised exclusively on web and touch technologies, forgetting that both are the results of constraints. The web was not meant to be a UI platforms and have poor primitives, and touch devices lack precise positioning and

    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.

  • all2 48 minutes ago
    The acronym collision is entertaining. I now want to use CUI to mark up my CUI.
  • cincinnatus 35 minutes ago
    Shame to put effort into encouraging more C code. All C code needs to be torn out by the roots. I don't care how carefully crafted it is and how many Fable passes have been done, it is inherently unsafe.
    • Luke2642 9 minutes ago
      Embedded guy here... Nah. No MMU, no problem. ;-)

      Well, fewer problems!