5 ms·
Show HN: Nimwave – build TUIs for the terminal, web, and desktop
- julianbuse 4y agoI've been trying to roll this myself, so it's pretty cool that someone build this.
- deleted 4y ago[deleted]
- inawarminister 4y agoBeen 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...
- deleted 4y ago[deleted]
- jiehong 4y agoPretty cool! How is the accessibility of such TUIs on different display tech?
- sekao 4y agoRight 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
- haskellandchill 4y agoI'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 4y agoEmacs? I'm only partially joking
- haskellandchill 4y agoHa, 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 4y agoLooks cool! Recently I've found this one too - https://github.com/ArthurSonzogni/FTXUI https://github.com/ArthurSonzogni/FTXUI
- mordechai9000 4y agoI'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.
- elcritch 4y agoThis 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/ee3b06f52e666b2a854eb79a47a50c62b5f2b1d7/tests/testApplies.nim#L64 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 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/f65876af34797f308b8d367124c76d8305daa158/src/fidgetty/widgets.nim#L247 https://github.com/elcritch/fidgetty/blob/f65876af34797f308b... Sorry for the link spamming, I just find the overlap of UI state management without OO interesting!
- capableweb 4y agoMaybe 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.
- nxrabl 4y agoI had to search for it, but it looks like the author originally wrote this library as part of their Ansiwave BBS project, which is here: https://bbs.ansiwave.net/bbs/ https://bbs.ansiwave.net/bbs/
- narimiran 4y agoMake 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 https://github.com/oakes/vim_cubed [1] https://www.youtube.com/watch?v=cBqBfPRWla8&list=PLxLdEZg8DRwRXNrY7yyGU0-g_GRSyRGKo&index=12 https://www.youtube.com/watch?v=cBqBfPRWla8&list=PLxLdEZg8DR...