this post was submitted on 30 Aug 2022
8 points (100.0% liked)

General Programming Discussion

7814 readers
5 users here now

A general programming discussion community.

Rules:

  1. Be civil.
  2. Please start discussions that spark conversation

Other communities

Systems

Functional Programming

Also related

founded 5 years ago
MODERATORS
 

I really like tui applications, because they are sustainable, efficient, distraction free and often do one thing in which they are good in.

But I can't find a good application for every purpose I need and want to create my own tui application.

And the only thing I know of is ncurses. But because it's really old, I don't know if it's still state-of-the-art or are there better solutions?

Which language would be the best to create a sustainable tui application?

Thanks for your help :)

top 14 comments
sorted by: hot top controversial new old
[–] seahorse@midwest.social 7 points 2 years ago* (last edited 2 years ago) (1 children)

I don't know much about the pros and cons of different languages you could write a tui in but the tui crate in Rust is pretty cool: https://docs.rs/tui/latest/tui/

[–] utopify_org@lemmy.ml 1 points 2 years ago (1 children)

This looks amazing!

But I am in a bad situation right now. I started to learn a new language a few days ago. It's Elm. And I don't know if starting to learn Rust would be good or not.

Are you actively coding in Rust and would you recommend to learn it over other languages?

[–] MadScientist@sopuli.xyz 7 points 2 years ago (1 children)

rust is great and pretty easy to learn. it has a similar data-oriented and functional-inspired style to Elm, and also similar philosophies from the devs. i'd say at least try it out, because you'll figure out whether you like it not too far into learning it

[–] quaver@lemmy.ml 3 points 2 years ago

I wouldn't say Rust is that easy to learn. You can get the basics pretty quickly, but it feels a bit frustrating until you get over the initial learning hurdle. Extremely satisfying language though, I strongly recommend it.

[–] nachtigall@feddit.de 4 points 2 years ago (1 children)

What programming languages are you looking for?

Since you are currently learning Elm, there is the Go library Bubble Tea which took inspiration from Elm's architecture. Another option for Go would be tview.

Otherwise, you could find a list of libraries in the awesome-tuis repo.

[–] utopify_org@lemmy.ml 2 points 2 years ago

I just invested hours to go throw the awesome tui list and test (a few) tui apps. It's amazing what kind of applications even exist.

This could take a while to filter out the good ones :O

[–] dressupgeekout@lemmy.ml 2 points 2 years ago (1 children)

I wouldn't call curses/ncurses "old." There are multiple implementations that are maintained to this day, and they work perfectly well.

[–] utopify_org@lemmy.ml 2 points 2 years ago (1 children)

But are they state-of-the-art and modern? What I mean by that is really efficient, like energy-efficient, small and fast. Old software has sometimes the problem that old code can't be removed, because it is just the core of it or would take too much time. Newer software could learn from that and be much better.

Okay, writing about it I realized that modern websites eat up most resources of high-end pcs just while scrolling through. This is something I don't had in mind :D

[–] dressupgeekout@lemmy.ml 3 points 2 years ago (1 children)

Well, you're wanting to write a TUI in the first place, which (arguably) means you're not really looking for "state of the art" or "modern" -- if you see what I mean.

And if one wants to write a TUI app, then curses is the most natural and least bloated way I can think of to make that happen.

And you don't need to resort to writing your app in C -- lots (most?) programming languages have bindings to curses. I've written a curses app in Ruby, for example.

[–] utopify_org@lemmy.ml 1 points 2 years ago (1 children)

Is your Ruby application open source? I am curious for what it is :)

[–] dressupgeekout@lemmy.ml 3 points 2 years ago* (last edited 2 years ago) (1 children)

Yes they're open source. They're also not terribly interesting and I haven't updated them in many years, but maybe I should fix that!

https://github.com/dressupgeekout/pless https://github.com/dressupgeekout/pres

[–] utopify_org@lemmy.ml 2 points 2 years ago

Finally someone who uses #!/usr/bin/env in their scripts.

[–] leanleft@lemmy.ml 0 points 2 years ago (1 children)

There's gtk or javascript. Not tui

[–] utopify_org@lemmy.ml 2 points 2 years ago

And the sky is blue...