Curses vs. ncurses?

hey, everyone. need a little clarification. what exactly is the difference
between curses library and ncurses? i know the n stand for new so I know
it's a newer version or replacement, but I guess what I really want to know
is are they interchangeable? if I know curses, do I already know ncurses or
is it a whole different beast? I just started working with curses but I was
just looking for some documentation but everything is on ncurses. I
originally went with curses since it's part of the stdlib (or used to be)
but after a lot of googling I'm thinking I may be using something obsolete?
is it worth learning or should I try to forget what I already learned and
switch to ncurses?

I don't claim to know the definitive answer, but I believe that one is
just an updated version of the other. I've worked with both (not in
Ruby, but over the years), and I honestly couldn't tell you the
difference. That being said... I'm tempted to think that the curses
implementation may well have been ncurses, anyway, as I'm pretty sure
ncurses predates Ruby, itself.

-Ken

···

On 2016-11-23 22:11, Micky Scandal wrote:

hey, everyone. need a little clarification. what exactly is the difference between curses library and ncurses? i know the n stand for new so I know it's a newer version or replacement, but I guess what I really want to know is are they interchangeable? if I know curses, do I already know ncurses or is it a whole different beast? I just started working with curses but I was just looking for some documentation but everything is on ncurses. I originally went with curses since it's part of the stdlib (or used to be) but after a lot of googling I'm thinking I may be using something obsolete? is it worth learning or should I try to forget what I already learned and switch to ncurses?

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk [1]>

Links:
------
[1] http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk

You can just run 'man ncurses', it has much useful information

Here is a quote from there:

The ncurses library emulates the curses library of System V Release 4 UNIX, and
XPG4 (X/Open Portability Guide) curses (also known as XSI curses). XSI stands
for X/Open System Interfaces Extension. The ncurses library is freely
redistributable in source form. Differences from the SVr4 curses are
summarized under the EXTENSIONS and PORTABILITY sections below and described in
detail in the respective EXTENSIONS, PORTABILITY and BUGS sections of individual
man pages.

···

On Wed, Nov 23, 2016 at 07:11:04PM -0800, Micky Scandal wrote:

hey, everyone. need a little clarification. what exactly is the difference
between curses library and ncurses? i know the n stand for new so I know
it's a newer version or replacement, but I guess what I really want to know
is are they interchangeable? if I know curses, do I already know ncurses or
is it a whole different beast? I just started working with curses but I was
just looking for some documentation but everything is on ncurses. I
originally went with curses since it's part of the stdlib (or used to be)
but after a lot of googling I'm thinking I may be using something obsolete?
is it worth learning or should I try to forget what I already learned and
switch to ncurses?

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

You can just run 'man ncurses', it has much useful information

That actually brings up a different issue. As far as I can tell, nothing on
my system relating to ruby except for IRB and Ruby itself have man pages
(running backbox 4.6. Essentially ubuntu)

You can read it on the web https://linux.die.net/man/3/ncurses

It is unlikely that you have used "curses", because it is something ancient
and abandoned. Ncurses is the only library used to manipulate terminal screen
today. Even my router has libncurses 5.9

Also, ncurses is a superset of curses, so if you learned curses somewhere, api
should work for ncurses.

···

On Thu, Nov 24, 2016 at 10:28:17AM -0800, Micky Scandal wrote:

You can just run 'man ncurses', it has much useful information

That actually brings up a different issue. As far as I can tell, nothing on
my system relating to ruby except for IRB and Ruby itself have man pages
(running backbox 4.6. Essentially ubuntu)

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

It is unlikely that you have used "curses", because it is something ancient
and abandoned.

Oh, maybe that is the case. I just went back to look, and this is the
original gem I used that I was thinking was curses:
  curses | RubyGems.org | your community gem host
but it does mention ncurses in the description. but the thing that still
has me confused is, what's actually labelled as ncurses(ncursesw or
ffi-ncurses) has different methods than the first one. there's definitely a
lot more in ncurses but even basic stuff like Curses.init_scrren is
different. That's why I thought I was using the old one. so if the first
one is actually ncurses why do they have different methods? don't get me
wrong, the differences are minor. like curses uses init_screen and ncursesw
uses initscr. are they just different peoples own versions based off the
original or something? if that's the case then is there a specific version
people would recommend? I'm using ncursesw now since it has the most
downloads by more than 100,000

> It is unlikely that you have used "curses", because it is something ancient
> and abandoned.
>

Oh, maybe that is the case. I just went back to look, and this is the
original gem I used that I was thinking was curses:
  curses | RubyGems.org | your community gem host
but it does mention ncurses in the description. but the thing that still
has me confused is, what's actually labelled as ncurses(ncursesw or
ffi-ncurses) has different methods than the first one. there's definitely a
lot more in ncurses but even basic stuff like Curses.init_scrren is
different.

I think an important point that has been overlooked in this conversation
is that, like many gems, the (n)curses gems are bindings to established
C-based libraries. That's what curses and ncurses were before anyone
wrote code to work with them in Ruby. Sometimes the Ruby ecosystem ends
up with multiple interfaces to the same C library.

···

On Thu, Nov 24, 2016, Micky Scandal wrote:

That's why I thought I was using the old one. so if the first
one is actually ncurses why do they have different methods? don't get me
wrong, the differences are minor. like curses uses init_screen and ncursesw
uses initscr. are they just different peoples own versions based off the
original or something? if that's the case then is there a specific version
people would recommend? I'm using ncursesw now since it has the most
downloads by more than 100,000

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

--
        Eric Christopherson

That's pretty much what I was thinking. and based on that thought I figured
it doesnt really matter too much which version I use. So I decided to go
with ncursesw. it's the one that has the most downloads (180,000+) and as
far as I could tell has the most features and best documentation, although
ffi-ncurss also looks like it has some decent meritts like being compatible
with jruby. I guess it just boils down to "what are you using it for"

thanks again for all the help and to all of you in the U.S of A, happy
(belated) thanksgiving!

···

On Thu, Nov 24, 2016 at 7:58 PM, Eric Christopherson < echristopherson@gmail.com> wrote:

Sometimes the Ruby ecosystem ends
up with multiple interfaces to the same C library.