This article is machine translated
Show original

Since I started Vibe Coding, whenever I needed a CLI/TUI tool, I began building them in Rust for performance reasons. Even though I knew almost nothing about Rust! However, regarding interpretation and AI modification, tools like Python's Textual or JS's Ink have intuitive syntax and are convenient, but I was constantly bothered by runtime dependencies and performance overhead. So, regarding Rust, while ratatui has a good ecosystem and provides some AI assistance, I felt that it didn't have an AI-native structure (that is easy to understand). Therefore, I created two things. 1. tui.builders - An editor that visually designs a terminal UI in the browser and exports Rust code. I built it with the goal of achieving usability similar to Figma. tui.builders When you drag a widget and set its properties in the Inspector, code is generated 1:1: - Inspector: width=30, padding=2, border=rounded - Code: .w(30).p(2).border(Border::Rounded) Because of this, you can easily create TUI tools by building them on the web with an editor like Figma, exporting them immediately, and editing them alongside AI. 2. SuperLightTUI - And this is a Rust TUI library designed for this 1:1 mapping. CSS flexbox + Tailwind Since it uses a utility class approach, if you have web development experience, you can set up layouts without any separate learning. For example, you can write code with the following structure. slt::run(|ui| { ui.bordered(Border::Rounded).p(2).gap(1).col(|ui| { ui.text("hello").bold().fg(Color::Cyan); if ui.button("click").clicked { count += 1; } }); }); A single closure defines the entire app. It renders in just three lines of code, without an App struct, event loop, or trait implementation. I have incorporated many elements that I deem necessary, such as immediate-mode rendering and over 50 widgets (charts, tables, images, AI widgets, etc.). Of course, I am still not entirely satisfied with the visualization library and am working on detailed modifications, but I hope this will be helpful to those who want to maintain Rust TUI performance while keeping development speeds up. Feedback is always welcome. - tui.builders: tui.builders - GitHub: github.com/subinium/SuperLight... -

Telegram
Disclaimer: The content above is only the author's opinion which does not represent any position of Followin, and is not intended as, and shall not be understood or construed as, investment advice from Followin.
Like
Add to Favorites
Comments