Proposal Proposal: haskell-gui addendum to haskell standard

Hello Everyone, I believe that haskell would have great benifit from a platform independant specification for a graphical user interface module or set of modules. I've been blessed with a lot of time on my hands so I'd be willing to organize this project if needed. Since there are several working haskell gui libraries out there, I would like this to be a collaboration project with those who are experienced in this area. Input and ideas from users would also be a part of the collaberation. The goal would be a specification much like the haskell report that could be freely implimented and a reference impementation. This is an informal proposal for a proposal and would like to get some feedback for the following ideas. (please reply to gui@haskell.org) 1. Platform independance: The QT widget library is a stunning example of how platform independance is achievable without sacraficing speed. I am not suggesting that we build haskell-gui off of QT but might use major components of it as a model. Eventually, the library could have three backends; the Windows API, the X API (or gtk perhaps?), and the Mac API (the name illudes me at the moment). 2. Signals support: Having a signals mechanism is essential for large gui projects. 3. Dynamic widgets: All widgets should have dynamic size and should have the ability to be resized by the measurement of their contents or their parents. This could be done in a way similar to QT widgets. 4. GUI GUI builder: Widgets should be flexible enough to have the ability to be incorporated in a GUI GUI builder program, such as QT designer. The storage for a GUI builder might be direct Haskell code or some intermediate format. 5. OpenGL incorporation: haskell-gui should have some sort of OpenGL widget as OpenGL is the most standardized and multiplatform graphical library availible. Perhaps the hgl software could be incorporated in this aspect of haskell-gui. 6. Custom Widgets: It should be easy for one to create his or her own custom widgets from scratch using Haskell code or by some modification of the standard ones. Please give your feedback and suggestions for this project proposal proposal. If there is enough interest, I'll get this thing started. Kudos, David J. Sankel Head Consultant Electron Consulting (www.electronconsulting.com)

[replying in GUI only]
I believe that haskell would have great benifit from a platform independant specification for a graphical user interface module or set of modules. I've been
Absolutely!
blessed with a lot of time on my hands so I'd be willing to organize this project if needed.
That would be great.
1. Platform independance: The QT widget library is a stunning example of how platform independance is achievable without sacraficing speed. I am not suggesting that we build haskell-gui off of QT but might use major components of it as a model. Eventually, the library could have three backends; the Windows API, the X API (or gtk perhaps?), and the Mac API (the name illudes me at the moment).
Why do you suggest basing it on QT? Gtk is also platform-independent (Unix and Win32), and there are already two Haskell bindings for it. I think neither QT nor Gtk are appropriate as a basis for designing a standard Haskell GUI - they are both specific toolkits, with loads of features specific to each. A standard GUI will have to be fairly minimal, so it can be easily implemented on top of several toolkits. The beginnings of the last go at a standard GUI library are documented here: http://haskell.org/communities/11-2001/html/report.html#sect4.3.1 Thanks for your prompting and offer of time! It would be great to get this off the ground. Cheers, --KW 8-)

On Wednesday, 2003-01-22, 17:40, CET, David Sankel wrote:
[...] 1. Platform independance: The QT widget library is a stunning example of how platform independance is achievable without sacraficing speed. I am not suggesting that we build haskell-gui off of QT but might use major components of it as a model. Eventually, the library could have three backends; the Windows API, the X API (or gtk perhaps?), and the Mac API (the name illudes me at the moment).
In my opinion the big problem of Qt and similar libraries is that they are not based on high level APIs. For instance, under Windows, Qt doesn't use the support for handling buttons, checkboxes etc. that Windows provides but provides its own handling of these widgets. Some drawbacks of such a concept are: (1) The look and feel of applications written with the multi-platform library will probably differ from that of native applications. (2) The library will not properly use settings made in a platform-specific way like, for example, file type settings which should be used in file selection dialogs. Qt is IMO fine as the basis of KDE but not so fine as a multi-platform GUI library. IMO, APIs, a Haskell multi-platform GUI should be based on, should be as high level as possible. Also consider, that today the graphical aspect of the user interface is not everything. It would be nice if such a library would also care, for instance, about accustic signals. I would propose the following backends for the library: * KDE (not just Qt) * Windows API or .NET * some reasonable MAC library (I think there are two at the moment.)
2. Signals support: Having a signals mechanism is essential for large gui projects.
3. Dynamic widgets: All widgets should have dynamic size and should have A the ability to be resized by the measurement of their contents or their
I'm not a Haskell GUI expert but I wonder if there is a more "haskellish" solution here. parents. This could be done in a way similar to QT widgets. I totally agree with you here. Again I would like that a multi-platform library is based on the API which is as high level as possible. This means that I would use the Qt resizing mechanisms under KDE and a custom implementation of resizing under Windows (since, AFAIK, there is no resizing provided by the Windows API nor the .NET API).
4. GUI GUI builder: Widgets should be flexible enough to have the ability to be incorporated in a GUI GUI builder program, such as QT designer. The storage for a GUI builder might be direct Haskell code or some intermediate format.
No opinion here.
5. OpenGL incorporation: haskell-gui should have some sort of OpenGL widget as OpenGL is the most standardized and multiplatform graphical library availible. Perhaps the hgl software could be incorporated in this aspect of haskell-gui.
Again, I totally agree with you.
6. Custom Widgets: It should be easy for one to create his or her own custom widgets from scratch using Haskell code or by some modification of the standard ones.
Total agreement.
Please give your feedback and suggestions for this project proposal proposal. If there is enough interest, I'll get this thing started.
I think, there was already a consensus concerning the development of a standard Haskell GUI interface. The strategy was to develop a rather imperative interface which could be implemented using different APIs/underlying libraries and on which different "haskellish" GUI solutions could be based.
Kudos,
David J. Sankel Head Consultant Electron Consulting (www.electronconsulting.com)
Wolfgang Jeltsch

Why not use QT as the underlying GUI library? As you noted it is platform independent. It is something of a bitch to build, but most GUI libraries are. On 22-Jan-2003 David Sankel wrote:
Hello Everyone,
I believe that haskell would have great benifit from a platform independant specification for a graphical user interface module or set of modules. I've been blessed with a lot of time on my hands so I'd be willing to organize this project if needed.
Since there are several working haskell gui libraries out there, I would like this to be a collaboration project with those who are experienced in this area. Input and ideas from users would also be a part of the collaberation.
The goal would be a specification much like the haskell report that could be freely implimented and a reference impementation.
This is an informal proposal for a proposal and would like to get some feedback for the following ideas. (please reply to gui@haskell.org)
1. Platform independance: The QT widget library is a stunning example of how platform independance is achievable without sacraficing speed. I am not suggesting that we build haskell-gui off of QT but might use major components of it as a model. Eventually, the library could have three backends; the Windows API, the X API (or gtk perhaps?), and the Mac API (the name illudes me at the moment).
2. Signals support: Having a signals mechanism is essential for large gui projects.
3. Dynamic widgets: All widgets should have dynamic size and should have the ability to be resized by the measurement of their contents or their parents. This could be done in a way similar to QT widgets.
4. GUI GUI builder: Widgets should be flexible enough to have the ability to be incorporated in a GUI GUI builder program, such as QT designer. The storage for a GUI builder might be direct Haskell code or some intermediate format.
5. OpenGL incorporation: haskell-gui should have some sort of OpenGL widget as OpenGL is the most standardized and multiplatform graphical library availible. Perhaps the hgl software could be incorporated in this aspect of haskell-gui.
6. Custom Widgets: It should be easy for one to create his or her own custom widgets from scratch using Haskell code or by some modification of the standard ones.
Please give your feedback and suggestions for this project proposal proposal. If there is enough interest, I'll get this thing started.
Kudos,
David J. Sankel Head Consultant Electron Consulting (www.electronconsulting.com)
_______________________________________________ GUI mailing list GUI@haskell.org http://www.haskell.org/mailman/listinfo/gui
-- ---------------------------------- Seth Kurtzberg M. I. S. Corp. E-Mail: seth@cql.com Date: 22-Jan-2003 Time: 10:57:26 This message was sent by XFMail ----------------------------------

I think that we have two alternatives: 1. Design the standard haskell GUI library as a mid-level, IO based library, in wich code would look like the following: win <- newWindow "Hello world" btn <- newButton "Bye" insert win btn onClick btn (close btn) and then design a high-level interface, because the IO based approach uncomfortable. 2. Directly plan the high-level interface, and create backends for it onto the various platforms. In both cases, don't forget that the gtk and gtk2 bindings are in an advanced state, and they already handle signals. I guess that those would be the first two "platforms" onto wich implement the library. Also, remember that both gtk and gtk2 are available on windows, macos, linux and freebsd. Regarding the high-level interface, first of all: it HAS to come. There's no real utility in a language like haskell if mainly used in the IO monad. We have many examples of declarative user interfaces (FRAN appears the to me, but it's just an opinion), and I think that a declarative UI would exploit the power of a declarative language, really speeding up the development of robust applications. Now, stated that it has to come, and considering that the gtk and gtk2 bindings already implement an IO based approach, perhaps the best thing to do would be to design the high level library, with use cases, and work on it until we find a reasonable model. Then we can implement that model on everything we want, qt, gtk, windows, macos etc. Another idea that is always present in my mind: we could also adopt a document model, for example the new standardized XML models that are coming from sun and other major companies cooperation around openoffice. This model could be implemented as an user interface, and would ease printing and cut and paste between different applications. Vincenzo

Nick Name wrote:
In both cases, don't forget that the gtk and gtk2 bindings are in an advanced state, and they already handle signals. I guess that those would be the first two "platforms" onto wich implement the library.
Also, remember that both gtk and gtk2 are available on windows, macos, linux and freebsd.
In my experience, Gtk is not a realistic choice on Windows. Perhaps the situation has changed drastically for Gtk2 (I haven't looked), but Gtk 1.x apps don't look anything like Windows apps, are buggy, and behave badly (one example I remember: bring up a menu on you Gtk app, alt-tab to another application - now the menu from you Gtk app will be floating by itself (and clickable!) over the windows app). If we're going to pick one GUI toolkit, I'd recommend Qt or wxWindows, both of which try to blend in with whatever OS they're on. Regards, Bryn

On Wed, 22 Jan 2003 10:11:45 -0800
Bryn Keller
If we're going to pick one GUI toolkit, I'd recommend Qt or wxWindows, both of which try to blend in with whatever OS they're on.
I hope I am not the one who's concerned with free software on this mailing list, but qt is not free in its windows edition. I can't write a GPL'ed software and tell my users to download a non free library to run the program. On the other side, wxwindows is C++, it's difficult to bind to haskell. However, in my post I did not mean "do it with gtk or die". Absolutely. I meant "if we design an high level interface, we already have a portable low level binding to use as a first backend, so the backend is not an immediate concern". If gtk2 is still bad on windows, someone interested will do a binding for the windows API and implement a backend for the high level interface. And also a macos lover will do a binding and a backend for quartz. This can be done simultaneously to the main work, there are many windows haskellers I see, but on unix-like systems we already have a good job wich should not be thrown away. Besides, qt is implemented in a language wich supercedes C++, I don't think it would be easy to make an haskell binding for that. Vincenzo -- Teatri vuoti e inutili potrebbero affollarsi se tu ti proponessi di recitare te [CCCP]

I didn't know that QT isn't free for windows. On 22-Jan-2003 Nick Name wrote:
On Wed, 22 Jan 2003 10:11:45 -0800 Bryn Keller
wrote: If we're going to pick one GUI toolkit, I'd recommend Qt or wxWindows, both of which try to blend in with whatever OS they're on.
I hope I am not the one who's concerned with free software on this mailing list, but qt is not free in its windows edition. I can't write a GPL'ed software and tell my users to download a non free library to run the program.
On the other side, wxwindows is C++, it's difficult to bind to haskell.
However, in my post I did not mean "do it with gtk or die". Absolutely. I meant "if we design an high level interface, we already have a portable low level binding to use as a first backend, so the backend is not an immediate concern".
If gtk2 is still bad on windows, someone interested will do a binding for the windows API and implement a backend for the high level interface. And also a macos lover will do a binding and a backend for quartz. This can be done simultaneously to the main work, there are many windows haskellers I see, but on unix-like systems we already have a good job wich should not be thrown away.
Besides, qt is implemented in a language wich supercedes C++, I don't think it would be easy to make an haskell binding for that.
Vincenzo
-- Teatri vuoti e inutili potrebbero affollarsi se tu ti proponessi di recitare te [CCCP]
_______________________________________________ GUI mailing list GUI@haskell.org http://www.haskell.org/mailman/listinfo/gui
-- ---------------------------------- Seth Kurtzberg M. I. S. Corp. E-Mail: seth@cql.com Date: 22-Jan-2003 Time: 11:25:52 This message was sent by XFMail ----------------------------------

I believe that haskell would have great benifit from a platform independant specification for a graphical user interface module or set of modules. I've been blessed with a lot of time on my hands so I'd be willing to organize this project if needed.
I agree this is a big hole in Haskell's library support. IO/Higher level interface ------------------------- Haskell has a lot of high level GUI toolkits/proposals (ObjectIO/Haggis/Fudgets/Fran/etc) and a number of IO level interfaces which are more or (usually) less maintained. While programming at the IO level works, it does not give one much of an advantage versus programming in C, in sharp contrast to most other Haskell programming. The diversity of high level solutions which differ totally in outlook ("express the widget as a datastructure" versus "everything is a composition of functions") gives the impression that the library designers never used their toolkits in larger applications which would have made any rough edges painfully obvious. It seems therefore that a lot more work needs to go into this field before we know what a good high level Functional GUI toolkit looks like. Contrast this with more mature fields such as pretty printing, parsing, etc where there are many solutions all following the same ideas. Therefore while I would like to see a higher level interface than currently what seems best to me (a binding to GTK), it seems unlikely that this project will resolve that question completely. Perhaps the best would be to use an Object-IO like interface with mvars as proposed by Simon Peyton-Jones, simply because it's higher level than raw gui-calls and the Clean folks have used it cross-platform in a few real apps. SWT --- I have seen many positive comments about IBM's SWT which works on the following platforms: aix/motif hpux/motif linux/gtk linux/motif linux/qt macos/carbon qnx/photon solaris/motif win32/win32 win32-ce/win32 It's a java binding to a native interface layer. Perhaps the fact it is architected as a binding could ease the creation of a similar Haskell binding which would work on all those platforms. http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/platform-swt-home/dev.ht... Sengan

--- David Sankel
1. Platform independance: The QT widget library is a stunning example of how platform independance is achievable without sacraficing speed. I am not suggesting that we build haskell-gui off of QT but might use major components of it as a model. Eventually, the library could have three backends; the Windows API, the X API (or gtk perhaps?), and the Mac API (the name illudes me at the moment).
I am already started development in that way. There is one Haskell library with two backend one for Win32 and other for GTK. The backends are written in C and over that is the Haskell layer. The development of backends was started in my first attempt to port ObjectIO to GTK. But the trouble with ObjectIO was that its current implementation is too Windows specific for that reason I was started HToolkit project at SourceForce. In the new project, the backends are extended far away behind ObjectIO limitations. In the last few weeks we together with Daan Leijen was started development of the new Port library. The goal is to separate HToolkit GUI library in two levels. The low level is a simple portable library with raw IO interface and the high level is HToolkit. This allows development of several high-level interfaces with common low-level. I completely agree that the standard GUI must have different backends in the different platforms. I am completely agree with Wolfgang Jeltsch:
In my opinion the big problem of Qt and similar libraries is that they ar= e not=20 based on high level APIs. For instance, under Windows, Qt doesn't use the= =20 support for handling buttons, checkboxes etc. that Windows provides but=20 provides its own handling of these widgets
In addition: I don't like to use nonnative libraries like GTK on Windows. Why need I use GtkButton widget when there is the standard BUTTON window? Krasimir __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
participants (8)
-
Bryn Keller
-
David Sankel
-
Keith Wansbrough
-
Krasimir Angelov
-
Nick Name
-
Sengan.Baring-Gould@nsc.com
-
seth@cql.com
-
Wolfgang Jeltsch