easygenes 3 days ago
  • selcuka 2 days ago

    For those who don't want to visit X:

        Most people's mental model of Claude Code is that "it's just a TUI" but it should really be closer to "a small game engine".
        
        For each frame our pipeline constructs a scene graph with React then
        -> layouts elements
        -> rasterizes them to a 2d screen
        -> diffs that against the previous screen
        -> finally uses the diff to generate ANSI sequences to draw
        
        We have a ~16ms frame budget so we have roughly ~5ms to go from the React scene graph to ANSI written.
    • PeterStuer 2 days ago

      This is just the sort of bloated overcomplication I often see in first iteration AI generated solutions before I start pushing back to reduce the complexity.

      Usually, after 4-5 iterations, you can get something that has shed 80-90% of the needless overcomplexification.

      My personal guess is this is inherent in the way LLMs integrate knowledge during training. You always have a tradeoff in contextualization vs generalization.

      So the initial response is often a plugged together hack from 5 different approaches, your pushbacks provide focus and constraints towards more inter-aligned solution approaches.

    • TZubiri 2 days ago

      How ridiculous is it that instead of a command line binary it's a terminal emulator, with react of all things!

      • someguyiguess 2 days ago

        Ok I’m glad I’m not the only one wondering this. I want to give them the benefit of the doubt that there is some reason for doing it this way but I almost wonder if it isn’t just because it’s being built with Claude.

    • esafak 2 days ago

      Kudos to them for figuring out how to complicate what should have been simple.

    • crgwbr 2 days ago

      Implementation details aside (React??), that sounds exactly like “just a TUI”…

      • someguyiguess 2 days ago

        Also React?? One of the slowest rendering front-end libraries? Why not use something … I don’t know … faster / more efficient?

    • someguyiguess 2 days ago

      Interesting. On first glance that seems over engineered. I wonder what the reason is for doing it that way?

      • mike_hearn 2 days ago

        If you don't do it that way then resizing the terminal corrupts what's on screen.

    • reissbaker 2 days ago

      Yes yes I'm familiar with the tweet. Nonetheless they drop frames all the time and flicker frequently. The tweet itself is ridiculous when counterpoints like Vim exist, which is much higher performance with much greater complexity. They don't even write much of what the tweet is claiming. They just use Ink, which is an open-source rendering lib on top of Yoga, which is an open-source Flexbox implementation from Meta.

  • stavros 2 days ago

    What? Technology has stopped making sense to me. Drawing a UI with React and rasterizing it to ANSI? Are we competing to see what the least appropriate use of React is? Are they really using React to draw a few boxes of text on screen?

    I'm just flabbergasted.

    • xpe 2 days ago

      There is more than meets the eye for sure. I recently compared a popular TUI library in Go (Bubble Tea) to the most popular Rust library (Ratatui). They use significantly different approaches for rendering. From what I can tell, neither is insane. I haven’t looked to see what Claude Code uses.

    • someguyiguess 2 days ago

      The further I scroll the more validated I feel for having the very same reaction.

    • TZubiri 2 days ago

      It's AI all the way down

      But it's very subsidizes when compared to API tokens, so we are all being paid by VCs to write prompts actually.

  • Ey7NFZ3P0nzAe 2 days ago

    And that's why it's taking so much CPU and is a pain to use with tmux.