Subject: Re: [Summer of Code]Wide Character Support in curses
To: None <tech-userlevel@netbsd.org>
From: Jed Davis <jdev@panix.com>
List: tech-userlevel
Date: 06/13/2005 06:47:54
In article <20050613061111.GB13026@drowsy.duskware.de>,
Martin Husemann  <martin@duskware.de> wrote:
> 
> The only option I see is to provide both 8bit and 32bit versions of the
> structures and make the program tell curses (or curses figure out magically)
> that we are going to use wide characters. That way only wide character enabled
> programs see the increased memory footprint - but I have no estimate on the
> number of programs that will stay in the 8bit group for much longer (maybe
> some games can get away with that).

With the disclaimer that I know approximately nothing about the
interface or internals of curses, and am just assuming there's a
reasonable amount of abstraction there: I suspect there's room for much
more magic than that; for example, start in 8bit mode and then switch
the screen's representation to 32bit the first time a sufficiently
exotic character is called for.  That way your wide-char-enabled pager
won't take the extra memory just to read a plain ASCII (or even Latin-1)
man page, say.

That's fairly tame compared to some of the alternatives I thought of
while I was writing that, too.  Anyway, my point is: how much complexity
is called for here in the service of memory savings?

-- 
(let ((C call-with-current-continuation)) (apply (lambda (x y) (x y)) (map
((lambda (r) ((C C) (lambda (s) (r (lambda l (apply (s s) l))))))  (lambda
(f) (lambda (l) (if (null? l) C (lambda (k) (display (car l)) ((f (cdr l))
(C k)))))))    '((#\J #\d #\D #\v #\s) (#\e #\space #\a #\i #\newline)))))