Tl;dr: this is mostly about terminals, and if you don't care about them you needn't read it.

LK: By coincidence, 
I started drafting a terminal handling SRFI today. It's based on some 
quite detailed exploration of how terminals actually work nowadays and 
trying to distill that into the simplest reliable and portable 
framework. That work was different from the current approach in the 
draft SRFI in that I aimed to cover both Windows and Unix with the same 
interface. I have most of the details figured out but not all yet. Here 
is some of the resulting code: <https://github.com/lassik/cursory>.  

Terminal handling [on Windows] is completely different. The Windows console API is actually far more sane than the Unix terminal API (which IMHO is a total clusterfuck) because they didn't have to deal with legacy cruft (or weren't tempted to incorporate it).  [We talked a great deal about treating terminals as character-cell grids and how awful Unix is at this.  I pointed out how my very limited termios in SRFI 170 was meant for unusual CLIs rather than for TUIs.  I pointed to Termbox <https://github.com/nsf/termbox> as a possible minimum viable TUI.]

LK:  IMHO the right level of abstraction to standardize is something a little below Curses (more or less: the parts of curses that cannot be implemented in fully portable code across Unix and Windows).

JC: Curses is awfully hairy.  373 procedure calls,  4 macros, 8 data types, 186 constants.

LK: Here as in so many places, the natural law is: The complexity has to go somewhere. Curses is complex compared to termios but a lot of what it does is necessary and has to be reimplemented (poorly) by applications.  [JC doubts the actual necessity of all that.  Lassi agrees that overlap can probably be handled by the GUI these days, since TUI apps run in GUI windows.]

The Windows version would be best done via FFI but the API is very 
different (i.e. it's a normal API instead of the layers of sediment we 
have on Unix :)


John Cowan          http://vrici.lojban.org/~cowan        xxxxxx@ccil.org
We are lost, lost.  No name, no business, no Precious, nothing.  Only empty.
Only hungry: yes, we are hungry.  A few little fishes, nassty bony little
fishes, for a poor creature, and they say death.  So wise they are; so just,
so very just.  --Gollum