X11 libraries

Alastair Reid alastair@reid-consulting-uk.ltd.uk
Tue, 15 Apr 2003 00:34:12 +0100

John Meacham <john@repetae.net> writes:
> heck, lets dispense with the FFI altogether and just write some
> Haskell code to speak the X11 protocol :). I am only semi-serious
> (although such a project is entirely feasible).

The Fudgets project did just that.  (This must have been more than 9
years ago.)

> In any case there are some alternate client X11 libraries besides
> XLib which have some very nice features which are worth looking at
> if you are at all interested in the design of a modern interface to
> X.

It would certainly be hard to find a worse design.  It's some time
since I looked at Xlib in detail but I think the bit that disgusted me
most was that when an error occurs, Xlib calls your callback function
and then exits the program.  I consider it none of Xlib's business
what I do after it reports an error as long as I do not call into Xlib
again or I take steps to reset the state of Xlib.  In my opinion, it
is appropriate for a library to decide that the library can no longer
continue but it is not appropriate for a library to decide that the
entire program must exit now.

Alastair Reid                 alastair@reid-consulting-uk.ltd.uk  
Reid Consulting (UK) Limited  http://www.reid-consulting-uk.ltd.uk/alastair/