A GUI toolkit looking for a friend

Simon Peyton-Jones simonpj@microsoft.com
Tue, 20 Feb 2001 06:59:58 -0800


Gentle Haskellers

This message is to invite offers to complete a promising 
port of the Clean Object I/O library to Haskell.  

As you know, there are quite a few GUI toolkits for Haskell, but
none of them has become a de-facto standard.  One confusing aspect
is that there are different "levels":
	(see http://haskell.org/libraries/#guigs)

* Low-level veneers on top of existing libraries.  HOpenGL, GTK,
  TclHaskell, the Win32 library, all fall into this category.  They
  are rich, but hard to use because you have to adopt the programming
  model of the library, which is usually very imperative.

* Very high-level systems, such as Fudgets, Haggis, FranTk.  These
  are rather sophisticated and (esp Fudgets, FranTk) attempt to break
  with the imperative programming model.  But I don't think any of them 
  has been acclaimed as The Right Way To Do It.  We're still looking!

* Strangely, there are very few "in the middle" systems.  One might hope
  for an interface that was somewhat independent of the low-level library,
  and somewhat more Haskell friendly, than the low-level veneers, but
  not as ambitious as the high-level systems.  

On top of that, some libraries deal in graphical user interfaces (buttons,
menus..) and some deal in graphics (pictures, lines, shading).  


I think we should encourage the development of more "in the middle" 
systems.  One example is Koen Claessen's Yahu system,
http://www.cs.chalmers.se/Cs/Grundutb/Kurser/afp/yahu.html
However, there is another functional language that has put years of
development into a GUI library: Clean.  The Clean Object I/O library is
well-documented and the Clean team have had a lot of experience in 
using it.  It runs on both Windows and Mac, but not currently on Unix.
http://www.cs.kun.nl/~clean/About_Clean/page_modified/page_modified.html


Maybe we should build on their experience!  Peter Achten, its author, spent
a
few weeks in Cambridge, porting the Clean library to Haskell.  The results
are
very promising.   The main ideas come over fine, translating unique-types to
IO monad actions, and the type structure gets a bit simpler.

So what we need now is to complete the port.  Peter didn't have time to
bring over
all the widgets, nor did he have time to clean up the Haskell/C interface.
(Clean's
FFI is not as well-developed as Haskell's, so the interface can be made much
nicer.)  The other significant piece of work would be to make it work on
Unix,
perhaps by re-mapping it to GTK or TkHaskell or something.

So the main burden of this message is:

	Would anyone be interested in completing the port?

Fame (if not fortune) await you!   The prototype that Peter developed in is
the 
hslibs/ CVS repository, and the GHC team would be happy to work with you to
support your work.   (The more compiler-independent we can make the library,
the better.)    Peter Achten is willing to play consultant too.  The Clean
team are happy for the code to be open source -- indeed, all the hslibs/
code
is BSD-licensed.  

It would not be the work of a moment.  There are subtle issues involved
(especially
involving concurrency), and the design is not complete, so it isn't just
boring hacking.
So it should fun.

Anyone interested?  Maybe more than one person could work on it together.

[And are there any other "in-the-middle" libraries I've overlooked?]

Simon