Settings

Theme

Show HN: Nimwave – build TUIs for the terminal, web, and desktop

github.com

195 points by sekao 4 years ago · 15 comments

Reader

elcritch 4 years ago

This looks great for those small TUI’s that you think “gosh I’d like a simple CLI to automate this”! Being able to produce small binaries or self contained static ones with a few compile flags is really great.

As someone working on a Nim widget library (and funny enough currently stuck on fixing up the text editing story..) I find this doubly interesting. Now I kinda want to see if I could plug this into a widget for it for kicks. Hmmm…

@sekao you might find this macro I split out recently useful if you want to tryout a Kivy-like api (gui things inspired my need for it): https://github.com/elcritch/cdecl/blob/ee3b06f52e666b2a854eb...

I also found that `useState` pattern from React with the variant library a handy pattern: https://github.com/yglukhov/variant and it’s pretty simple to do if you already have a context object: https://github.com/elcritch/fidgetty/blob/f65876af34797f308b...

Sorry for the link spamming, I just find the overlap of UI state management without OO interesting!

mordechai9000 4 years ago

I've been toying with the idea of setting aside some time to learn Nim. I'm really excited about the goals and philosophy of Nim, but I'll have to spend some time getting my hand dirty to even know enough to have an opinion on it. This looks like a fun project to play with once I get the basics down.

narimiran 4 years ago

Make sure to check other projects by the same author, some real gems there IMO (and I'm not even including there his most popular project - Vim^3 [0] :D). This talk [1] from NimConf 2021 is a good place to start:

[0] https://github.com/oakes/vim_cubed

[1] https://www.youtube.com/watch?v=cBqBfPRWla8&list=PLxLdEZg8DR...

capableweb 4 years ago

Maybe I'm blind, but since it mentions TUI for the "web", I'd expect a web example where I can see it working for myself. Is there one of those deployed somewhere? If not, definitely should, would make any demo 100% cooler.

inawarminister 4 years ago

Been playing around with Nim for a while. Awesome to see this! Might as well try to get some adventure games running as so can be played directly on the three platforms...

Does the web includes mobile browsers? Let me try...

haskellandchill 4 years ago

I'm interested in building a good text UI for terminal, for a REPL language kind of system, but also showing interactive state, and being able to manipulate expressions, etc. Any cool tools?

  • lytedev 4 years ago

    Emacs? I'm only partially joking

    • haskellandchill 4 years ago

      Ha, I use Spacemacs in terminal so I get the joke. Yes, it's a nice text manipulation environment. Making a small language and doing an emacs plugin isn't the worst approach.

malkia 4 years ago

Looks cool! Recently I've found this one too - https://github.com/ArthurSonzogni/FTXUI

jiehong 4 years ago

Pretty cool!

How is the accessibility of such TUIs on different display tech?

  • sekaoOP 4 years ago

    Right now not good but I have a plan for the web version. I'm going to overlay text fields, buttons and other things on top of the cells where they're being rendered. This is doable because nimwave has all the semantic information.

    For terminals there is no way to do this. I think we need a new standard to represent terminal interfaces that preserves this info. I have some ideas on how to do this in a backwards compatible way but I'm on my phone at a BBQ right now so I can elaborate later :P

julianbuse 4 years ago

I've been trying to roll this myself, so it's pretty cool that someone build this.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection