[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Adding wide support to the Ada binding?
From: |
Thomas Dickey |
Subject: |
Re: Adding wide support to the Ada binding? |
Date: |
Sat, 19 Aug 2017 21:46:41 -0400 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Wed, Aug 16, 2017 at 07:50:13AM -0400, Patrick wrote:
> Hi Everyone
>
> I am spending a lot of time thinking about all the things I started
> and never finished this week. I spent all of 2012 learning about
> Ada. I largely failed. Ada is awesome but writing a binding for it
> is very painful. The binding are often about 1/3 of the code being
> bound and there is often a very small community using them and
> support for the binding becomes stale.
>
> Ada is like meeting the women of your dreams only to find out that
> she has 6 weeks left to live. Everything I try to do with the
> language ends up at dead ends. I can imagine doing amazing things
> with it if I just had a library that I liked. I am thinking that
> with a bit of work, the ncurses binding might be just that.
>
> I was playing with the ncurses Ada binding last night. It does not
> have wide character support and I would need this if I used it
> extensively.
>
> How does the addition of wide support basically work in C ncurses? I
> know that with UTF-8, the first byte can be bitmasked to reveal how
> many bytes the UTF-8 "character" is composed of. Is this what
> ncursesw is based on?
In C, there's more than one interface: the X/Open one uses "wide characters"
(literally a number with "wchar_t" datatype), which often is taken to be
the same as Unicode. (But actually it's locale- and system-dependent, so
actually a CJK encoding/locale _could_ be different). ncurses also accepts
multi-byte character strings (read: UTF-8) in the addstr, etc., functions.
X/Open didn't do that...
While the compilers _may_ have caught up (the documentation doesn't seem
to...), I recall looking into this a few years ago, finding that I'd need
Ada2005, and at the time I could only get that by downloading onto my OSX
system - something like
https://sourceforge.net/projects/gnuada/
> Are I/O operations bitmasked and then reading and writing to the
> screen is done as 1 or more bytes rather then byte by byte?
>
> Would it just be a matter of intercepting all I/O and applying this
> concept ?
no - it would be in finding how to map the Ada2005 wide-character types
into a binding for the ncurses functions using wchar_t and/or cchar_t
--
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://ftp.invisible-island.net
signature.asc
Description: Digital signature