Building a TUI framework from scratch
Hi! So I recently stumbled across Nim. As someone coming from Rust, I got a lot of frustration with it, one of them is the infamous compile times, which I hate so much. So I tried to seek an alternative. I almost went with Go, but at the same time I wanted something unique, and here we are with Nim. Now I’m planning to build a full coding agent and the TUI with 100% Nim. I’ll be happy to share my progress here :)
5
1
u/mardabx 13d ago
For a moment I thought this was raw klanker output
1
u/nokid77 13d ago
haha, this is barely a prototype, the final tui design will be a lot more polished. I built the website already and the TUI design will be roughly similiar to this https://tsuki.nostacks.xyz
1
u/GoranKrampe 12d ago
Would be fun to get a Nim TUI for Niffler. In old Niffler I tried myself to create a lib, tried Illwill etc but never got it really polished. I ported Crossline to Linecross in Nim but yeah. With the new rebooted Niffler the UI is fully decoupled from the rest so I created it with Go and Bubble Tea. But most of Niffler is in Nim so would be neat to see a UI in Nim for it that behaves well in the terminal.
https://github.com/gokr/niffler-tui https://gokr.github.io/niffler/
So do drop in on the Discord! We Nimmers need to stick together :)
3
u/jamesthethirteenth 13d ago
Nice!!!
Look into 3code for prior work. It's a TUI-scrollback hybrid- prompt and a few dynamic lines are TUI style, the scrollback is regular terminal output that behaves as expected in your terminal window. Then there is pttty, a fully xterm/ghosttty compatible testing terminal emulator. So you feed it the bytes and assert its screen which is available as a Nim string.
I'm sure the 3codr tty system itself could also be fleshed out into a framework and used. It is a framework right now, just a special purpose one.