Rust port of Claude Code's TUI via iocraft
RustComments
I think the emulator is one thing... but the memory overhead of the Node runtime is another... wouldn't the Rust version be much lighter on system resources?
We saw a similar attempt to map React hooks to Rust with early Leptos experiments for TUIs. Those usually hit a wall with the borrow checker when managing complex component trees. I wonder if iocraft actually solves that or just avoids it.
The repo actually implements a custom event loop to mimic Ink's reconciliation process. This is more than a UI port; it is essentially a proof of concept for a virtual DOM in a terminal environment using Rust.
To be precise, the reconciliation is likely happening via a diffing algorithm on the buffer. The real challenge is how iocraft handles the layout engine without the CSS-like flexibility that Ink provides through Yoga.
Seeing a working implementation of a virtual DOM for TUIs in Rust could encourage more developers to build accessible, complex terminal apps. It lowers the barrier for people who are comfortable with modern web patterns but want systems-level performance.
TypeScript is a bottleneck for high-refresh TUIs. Moving this to Rust is not just an exercise; it is a necessary step for reducing input lag in complex terminal interfaces.
does the rust version actually reduce the latency in a measurable way?
Similar claims were made when the community ported various CLI tools from Python to Rust. The perceived speed increase is often negligible compared to the bottleneck of the terminal emulator itself.