Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Idea/Suggestion - please feel free to ignore/close at any moment in time] Glimmer for the terminal? #23

Open
rubyFeedback opened this issue Jul 15, 2022 · 2 comments

Comments

@rubyFeedback
Copy link

rubyFeedback commented Jul 15, 2022

Heya Andy,

Recently there was a question on the ruby reddit site:

https://old.reddit.com/r/ruby/comments/vylge0/what_library_can_i_use_to_create_a_tui/

The shortish question asked by the threadstarter was:

"[What library can I use to create a TUI"

Some links given were:

https://ttytoolkit.org/
https://github.com/Shopify/cli-ui

The shopify UI is quite interesting, you can select the entries and have them
appear in different colours.

Here is that example: https://user-images.githubusercontent.com/3074765/33797984-0ebb5e64-dcdf-11e7-9e7e-7204f279cece.gif

Anyway. I am not suggesting you use ncurses - I myself hate the ncurses API so I don't recommend to people use it when I dislike it. :P But some projects created with it are quite nice. For instance, the linux distribution GoboLinux had AbsTK (abstract toolkit) and it combined a terminal interface as well as a GUI, for installing gobolinux).

So my idea - and it is really just an idea, don't worry about investing time here - is ...

What if we can do "write once, run eveywhere" via glimmer? That is we write glimmer
libui application but it could also work on the commandline as-is. May be hard, and we
have to abstract a way lot of things, but could be doable.

Or, perhaps that may be more logical, to START with a commandline basis, for quick
stuff prototyping; and at a later point when a library works well and the user wants to
give it to other people too, to use it, a better GUI is done from that commandline
base. So we can start with the commandline, and at a later time "upgrade" it to a
full GUI. E. g. from TUI to GUI or something like that.

Anyway, this is really just meant as an idea. I think you played around with some terminal
user interface, but most work you do in regards to glimmer probably goes into SWT and
libui and ruby-tk and so forth I think. Would be kind of intereresting to have games such
as snake or tetris or tic-tac-toe all work on every glimmer "platform", including the commandline.

@AndyObtiva
Copy link
Owner

AndyObtiva commented Jul 15, 2022

I just did a quick glance of your message. Before I read in detail and answer every question, I'd like to mention that I already use a TUI in Glimmer DSL for SWT's glimmer command (via TTY toolkit, which does the same thing you mentioned about the Shopify tool, but with friendlier syntax in my opinion).

glimmer-dsl-swt-glimmer-command-tui

@AndyObtiva
Copy link
Owner

What you suggest is a good idea. I'd be happy to support a Glimmer DSL for TUI that could enable building TUIs or automatically converting desktop apps built with Glimmer DSL for SWT or Glimmer DSL for LibUI into TUI apps just like how Glimmer DSL for Opal does that for the web (convering desktop apps into web frontend apps).

I'll keep this issue open until I've implemented such a DSL. It is low priority though as I need to finish adding more advanced features to Glimmer DSL for LibUI (like custom shapes, declarative area graphics drag and drop, and scaffolding) in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants