

Which Text-Based UI Do You Code With? 211
JHWH asks: "I've been asked to design and implement a management software system with text based user interface as the replacement of an older one running on AS/400. Despite my attempts towards a web UI, the customer is actually willing to have a text based UI. The main reasons are the need for a very low bandwidth and the ability to run on serial terminals. All this in the 21st century! Host systems will be Linux, the language will be C or C++. I already thought about the use of text based browsers like lynx or links. So now I have to wipe the dust away from my ncurses manual, or can Slashdot suggest something more effective?"
What's wrong with ncurses? (Score:3, Insightful)
Re: (Score:2)
Oh, and I don't think it's dumb to want a console app instead of a web app. Console apps can run *QUICKLY* on any old system of just about any OS or architecture with any speed CPU with any amount of RAM with any amount of bandwidth.
Re: (Score:3)
It's not about being the 21st century, it's about not being stupid. Slapping a web server on an embedded system just so you can interface to them is beyond asinine.
Re: (Score:2)
Re: (Score:3, Insightful)
The article title has nothing to do with the article contents.
... the title is "Which Text-Based UI Do Yo Code With" - not "Which Text-Based UI Library Do You Write To/Compile Against".
Re: (Score:3, Informative)
Except that it sounds like the client (probably a bank or a lotto agency) already has a considerable investment in serial terminals, so no DOS for you: The main reasons are the need for a very low bandwidth and the ability to run on serial terminals.
Menus, menus, menus (Score:2)
Re: (Score:2)
Re: (Score:2)
Simplicity. Most console UI's are simple. unlike web/GUIs the console UIs are simple and restrictive which means the users have little choice and there is consistant way of doing something. you don't have to worry about what will happen if the user tries to select a different window and stuff. This type of environment is very very usefull for data entry and similar environments.
Re: (Score:2)
Yeah, I'll third that. ncurses is completely A-OK for terminal apps to be deployed on Unix-style systems. Especially since you're wanting support for serial consoles.
In point of fact, I'm not familiar with any new advances in terminal display libraries since ncurses, really. I know that Red Hat uses a Python-based installer (Anaconda) that can support both a graphical/X display and a text-mode interface when no X display is available. It may be interesting to see what they are using, as I suspect they
Re: (Score:2)
Just write ansi escape sequences to the screen, same as back in the good ole days of writing bbs software.
Re:What's wrong with ncurses? (Score:5, Interesting)
And you will then discover some of the reasons why you should have used ncurses in the first place:
1. Does the cursor jump to the next line when you hit the 80th column?
2. If you type a character in the lower right corner, does it scroll up the screen?
3. Are they going to bring in some non-ansi terminals and expect you to make them all work?
4. Which subset of the ansi sequences are going to be available? Using xterm, gnome-terminal, putty, ansi.sys,
5. What other intresting "bugs" in all the possible terminals do you need to work around?
I'd rather use a library that already handles all the crap.
Re: (Score:3, Interesting)
Only if your terminal window is 80 columns wide. Of course, if you want it to no matter what the actual width, just insert a newline at col80 ...
Only if you haven't first set the terminal to raw input ...
Re: (Score:3, Informative)
To not use a terminal library like ncurses is completely stupid. To make a decent app, you would have to write the same support functions for various ops that ncurses provides already -- and it will likely handle quirks that you aren't even aware of but the almost 15 years of ncurses development have long since accounted for.
The only quest
Re: (Score:2)
Actually, some terminals will leave the cursor at column 80, and only advance to the next line after another character is output; others will put the cursor at column 1 of the next line immediately after a character is placed at column 80. Why does this matter? Well, if you output a character on column 79, then a cr/lf, you'll get the next output at the beginnin
Re: (Score:2)
What I would really drool for would be a ncurses port of WxWidgets.
I have confused memories someone tried it, but the project died. It would happily unite console and graphic programming.
Re: (Score:2)
Re:What's wrong with ncurses? (Score:4, Insightful)
I went the ncurses route on a robotic project I developed a few years back and things were way easier and the end result was much more desirable. I was using code that had been in development and tested for years rather than some fun project I built in my spare time at home.
I highly recommend not reinventing the wheel unless you have a really good reason.
Re: (Score:2)
http://catheadlabs.com/semi/menu.txt [catheadlabs.com] if anyones curious for an example. This was back when brained.org was still around, for anyone that remembers those days. I think theres a few raw escapes in there so watch out for them if you copy/paste.
Re: (Score:2)
Re: (Score:2)
what's the problem? (Score:3, Insightful)
It sounds like the client's needs are thought out and perfectly reasonable. The problem seems to be with the person they've asked to do the job.
Re: (Score:3, Insightful)
What's your beef? The guy is asking about the best way to do what his client wants, not opposing it.
Re: (Score:3, Insightful)
Re: (Score:2, Insightful)
I'd rather have text than web (Score:5, Insightful)
If you want a decent UI, don't bother with web-based stuff. Use a product like RealBasic, do it quick and make a CLI to do all the heavy lifting on the back-end.
Re: (Score:3, Insightful)
Then there's the web app that requires Sun Java and the web app that requires MS Java, both of which run only in IE, and both of which are supposed to run ON THE SAME MACHINE! (I have to deal with that situation once. Royal pain in the rear-end. I don't remember how I solved it, actually...)
Ah.. 1997 called, they want their rant back.
Seriously, Java's pretty clean and clear now, and much better than once it was. Especially with Java Web Start.
Does nothing to help the original poster, but there you
Re: (Score:2)
Then there's the web app that requires Sun Java and the web app that requires MS Java, both of which run only in IE, and both of which are supposed to run ON THE SAME MACHINE! (I have to deal with that situation once. Royal pain in the rear-end. I don't remember how I solved it, actually...)
Ah.. 1997 called, they want their rant back.
It 2007, and my browser uses Java 1.4.2 because a basic corporate app won't run on 1.5. You would recognize the company, We're a big Java supporter.
Re: (Score:3, Informative)
It 2007, and my browser uses Java 1.4.2 because a basic corporate app won't run on 1.5. You would recognize the company, We're a big Java supporter.
That's one of the things that Java Web Start gives you. You can have several versions of Java installed concurrently, and the JNLP launch file can specify which versions of Java are known to be compatible. If you don't have a compatible version, Java Web Start can even offer to go out and download the appropriate version for you.
We've been deploying our
Web application vs Java Webstart (Score:2, Informative)
A web application that depends on Java in the browser probably uses applets. That is not the best way to solve any problem since there are dependencies out of the programmers control (versions of Java on the client, browser problems,...), it is similar to a (windows only) ActiveX dependency.
Java Webstart is very different, it handles deploying Java Applications (typically Swing UI based impementations, nothing to do with Applets or JApplets), resolves Java version dependencies etc. Webstart uses any Java v
Re: (Score:2)
Here in the real world, I came across that real problem in the recent year of 2004. Maybe even early 2005.
Re: (Score:2)
While you can do such a thing, it should never be necessary. That it would be necessary is a sign of bad design.
Re: (Score:2)
Out here in the real world, 1997 hasn't gone away.
Re: (Score:3)
Did it ever go away?
In 2004, I worked for a 15,000 Fortune 50 company which required Microsoft Java (last updated in 1999?) for the web-based payroll system. There were hundreds of remote offices in this organization, IT support was completely fractured, and it took weeks (sometimes months) for the central IT organization to send out corporate copy of the MS JVM binaries to some remote offices, to the traveling salespeople, etc.. As a result, people were seeking M
Re: (Score:2)
One of these apps is a library cataloging/integration package called Aleph by a company calld Ex Libris. Libraries- stay away from this, it's shit, and so is their support. The latter was determined through what my bos
64bit browser plugin (Score:3, Insightful)
Re: (Score:2)
Fair enough. The fact remains that most of the text-based UIs I've used are actually usable and easy to install where most of the webapps I've used either:
1) Are incompatible with another webapp that needs to run on the same browser. (The Sun vs. MS Java problem mentioned above, for instance, or conflicting browser settings.)
2) Requires me to turn off EVERY SINGLE SECURITY FEATURE the browser
Emacs! (Score:2)
Re: (Score:3, Interesting)
--
Evan
Re: (Score:2, Informative)
web based with lynx (Score:4, Funny)
Re:web based with lynx (Score:4, Funny)
Something you might look into (Score:2, Redundant)
Ruby has hooks for curses (Ruby is a fairly simple language). It also has a database API and an object relational layer ActiveRecord (part of Rails but doesn't require rails). You might take a look at that. You can extend Ruby using C if you need or you can write the C/C++ programs as callable from inside of the ruby script.
This is NOT something I've done before (except for using Ruby and Rails and the database api). But it might be something to take a peek at.
Re: (Score:2, Insightful)
There's no reason in this day and age to write a non-performance-sensitive UI in C or C++! Especially a text based one. Why would you go through such hell for a task that doesn't require optimal performance? Seriously: you can learn Ruby and code the UI in less time than it will take you to code it in C or C++. I guarantee it. Plus it will be a lot more fun. And you can link in C and C++ modules to execu
Re: (Score:2)
I've used Ruby curses. Ruby curses is a very thin layer on top of the classic C curses library (ncurses actually). There is no significant value add above direct C programming other than you get modern memory management that comes with a modern language like ruby.
The crown jewel of the Ruby world is ActiveRecord - although it's not included in the base distribution, it is easy to bolt onto any ruby installation. I can't think of any database layer in any language that is easier to use than ActiveRecord
pokey reference (Score:3, Funny)
Conio!
Isn't there a linux port of that?
Re: (Score:3, Interesting)
why bother with conio (console i/o - a borland c / turbo c library) when you can just write the raw ansi sequences to the screen? They're really easy, and you can even prototype your interface with nothing more than a text editor (vi or notepad) and "playing" it to your terminal ("type 'filename'" in dos, "cat 'filename'" in linux).
http://www.dee.ufcg.edu.br/~rrbrandt/tools/ansi.h t ml [ufcg.edu.br] ansi escape sequences.
You can clear the screen, home the cursor, more the cursor to specific coordinates, erase to the
Re: (Score:2)
Re: (Score:2)
--
Evan
Python and ncurses would make a good combination (Score:4, Informative)
menu or command? (Score:2)
If you want a menu driven interface, everybody's already said ncurses is the best game in town.
If you're looking for a command-driven interface, it might be cool to embed guile (GNU's scheme interpreter) in the program and use that for the front-end. Guile works with readline, and it would give you the added benefit of making the application scriptable (with a sane, elegant, and un-hacked-together-over-6-different-versions language), basically for free.
Re: (Score:2)
curses... !@#%*$ (Score:2)
Text based UI is underrated! (Score:5, Insightful)
- support for hotkeys and shortcuts (especially big for manual data entry/call centre users)
- ability to easily rescale + resize to fit into available screen real estate.
It's simple for a terminal emulator to scale down fonts when the window is resized. Try that with your average GUI or web page.. not to mention component layout issues when dealing with GUIs. This may sound dumb, but it can be a big issue for call centres having to juggle multiple apps but with only one physical screen.
- simplified deployment (yes, even simpler than web) - no issues with browser versions, plugin conflicts, etc etc.
- SPEED! Compared with the latency of your average web front-end.
Issues like this really add up to a big difference for apps that are used intensively.
Re: (Score:3, Interesting)
Re: (Score:2, Insightful)
Re: (Score:2)
Re: (Score:2)
It's simple for a terminal emulator to scale down fonts when the window is resized. Try that with your average GUI or web page..
Actually, that works great with web apps and web pages by default.
Really? I don't think I've ever seen a web page that scaled down its fonts when you resized the window. I just get scroll bars.
Re: (Score:2)
I consider myself a web professional. And, curiously enough, what you're saying there is one of the prime reasons to use
Sadly enough, even the elite of flash designers, usually be
SLANG (Score:4, Interesting)
once recommended me to try using the slang API
instead of (n)curses based on the fact that he bought a ncurses book
and it sucked monkeyballs and programming ncurses is not really intuitive
some of the other fine folk who regularly sit idle in that channel
also said that if it could be done in a Shell script
you could try using shell and dialog which is a ncurses based program btw
this could obviously be a biased opinion from slackers since the pkgtools in slackware http://www.slackware.com/ [slackware.com] are written this way
and they have served us fine for many years
and will continue to serve us happily for many more years to come.
anyway good luck
Re:SLANG (Score:5, Funny)
Re:SLANG (Score:5, Funny)
Re: (Score:2)
It truly is a work of art.
Re: (Score:2)
I used to use slrn (news reader) and jed (editor), they're both written using slang and both are fine programs. All have the same author - John E. Davis [mit.edu]. So I would certainly look at slang.
That said, ncurses is the standard, it is mature, it is well known. You'd need to have some pretty special requirements before ncurses wasn't the best option, I think.
Re: (Score:2)
Try Charva (Score:2, Informative)
Turbo Vision! (Score:3, Interesting)
Screenshot from the link of it on QNX: http://tvision.sourceforge.net/tv2-QNX-tvscreen.j
The nice thing about it is that it's OO... one of the very first OO TUI's, if I remember correctly.
I have absolutely no idea how it'll work over a terminal. XTerms an option?
Gopher (Score:2)
Re: (Score:2)
Re: (Score:2)
--
Evan
Slang (Score:3, Informative)
slang1 - The S-Lang programming library - runtime version.
Description: The S-Lang programming library - runtime version
S-Lang is a C programmer's library that includes routines for the rapid
development of sophisticated, user friendly, multi-platform applications.
libslang1 - The S-Lang programming library - runtime version
libslang1-dev - The S-Lang programming library, development version
libslang1-pic - The S-Lang programming library, shared library subset kit
libslang1-utf8 - The S-Lang programming library with utf8 support
libslang1-utf8-dev - The S-Lang programming library, development version with utf8 support
libslang1-utf8-pic - The S-Lang programming library, shared library subset with utf8 support
libslang2 - The S-Lang programming library - runtime version
libslang2-dev - The S-Lang programming library, development version
libslang2-pic - The S-Lang programming library, shared library subset kit
libterm-slang-perl - perl interface to the S-Lang terminal library
slang-cfitsio - read and write FITS files from S-Lang
slang-curl - transfer files using HTTP and FTP from S-Lang
slang-gdbm - access to GDBM databases from S-Lang
slang-gsl - GNU Scientific Library binding for S-Lang
slang-gtk - binds the GIMP Toolkit (GTK) to the S-Lang scripting language
slang-histogram - create and manipulate histograms from S-Lang
slang-pvm - PVM (Parallel Virtual Machine) interface for S-Lang
slang-slirp - C code generator for the S-Lang scripting language
slang-tess - regression testing system for the S-Lang scripting language
libnewt0 - Not Erik's Windowing Toolkit - text mode windowing with slang
Description: Not Erik's Windowing Toolkit - text mode windowing with slang
Newt is a windowing toolkit for text mode built from the slang library.
It allows color text mode applications to easily use stackable windows,
push buttons, check boxes, radio buttons, lists, entry fields, labels,
and displayable text. Scrollbars are supported, and forms may be nested
to provide extra functionality. This package contains the shared library
for programs that have been built with newt.
libnewt-dev - Developer's toolkit for newt windowing library
libnewt-perl - Perl bindings for Erik Troan's newt text-mode windowing toolkit
libnewt-pic - Not Erik's Windowing Toolkit, shared library subset kit
libnewt0.52 - Not Erik's Windowing Toolkit - text mode windowing with slang
newt-tcl - A newt module for Tcl
pike7.6-pexts-newt - Pike Newt module
python-newt - A NEWT module for Python
whiptail - Displays user-friendly dialog boxes from shell scripts
JavaServer Faces (Score:2)
http://www.oracle.com/technology/tech/java/newslet ter/articles/introadffaces/index.html [oracle.com]
Assuming it works, that is pretty cool, a
Re: (Score:2)
TurboVision (Score:2)
When I was writing text-based PC apps in the early 90s, Borland's TurboVision blew me away. It was very easy to work with and it made building nice, windowed user interfaces a snap. Not only that, but full source was provided and that source was clean, elegant, and such an excellent demonstration of proper object-oriented design that I built an OO design class around it.
Borland released TurboVision to the world [codegear.com] after it was obsoleted by the takeover of GUIs, and some enterprising folks have ported it t [sourceforge.net]
you say ncurses. . . (Score:2)
Re: (Score:2)
Re: (Score:2)
Urwid? (Score:2)
Python + ncurses is all right (Score:2)
The size of the terminal forced me into text processing and cropping... roughly a third of my app is just processing text
tip1 = Try to do both; tip2=Text web! (Score:2)
Another tip: You could suggest creating a web application and make a Lynx (or Links) friendly webapp. Those text web browsers will run over telnet and they will be very friendly for them, as they share the "form orientation" of AS/400 form oriented 32
How about eLinks instead of Links? (Score:2)
Perl or Python + ncurses (Score:2)
ncurses it is (Score:2)
go web (Score:2)
Re: (Score:2)
We're well into the 21st century, and I see as many text based facilities as at the end of the 20th century. Like it or not, the console is not going away.
Before you torture yourself with ncurses (Score:2)
Yep, the old turbo vision. Very useful, object oriented, shortcut keys built-in. Mouse handling, very fast, very well debugged. Great stuff
Links is a great idea (Score:2)
One thing I *am* curious about, does Links support AJAX? I don't mean whizzy huge operating-system applications, just XMLHttpRequest and the ilk? Just the simple stuff, no graphics or so, just for form validation and
readline (Score:2)
GNUE? (Score:2)
Why not DECforms? (Score:2)
No, I'm not being facetious. It still works great. Especially over those serial connections.
http://h71000.www7.hp.com/commercial/decforms/ [hp.com]
let's see... (Score:2)
mark
Pico! (Score:2)
During grad school I wrote a recursive-descent Pascal compiler in Java using just plain old Pico; I guess my needs aren't that complex.
Use ncurses (Score:2)
Javascript or Flash of course! (Score:2)
If you want to get fancy, write the whole thing as an openGl app with hooks into the system and just use bash or tch as your CLI
Plan 9 has some answers, even for Linux boxes (Score:2)
You could use Sam [swtch.com] - written with remote editing across slow serial lines in mind.
Or import the remote file system in using srvssh [bell-labs.com] in plan9 or p9 [swtch.com] in p9port and use Acme [swtch.com]
Plan9port [swtch.com] is a port of the Plan 9 [bell-labs.com] userland to Linux / BSD / OSX
Re: (Score:2)
Higher-level libraries (Score:2)
Re: (Score:3, Insightful)
I'm an AS/400 guy, used to be a PC programmer. I'm trying to understand this, any comments
Re: (Score:2)
The question is about which text-based UI library is used, not which editor/IDE is used.
Serial ought to be compulsory for web designers.. (Score:2)
I personally don't even bother to wait for Flash and sound crap