Re: [Haskell-cafe] Building GUIs for Haskell programs

Can anyone attest to the sense (or otherwise) of the following programming "pattern"
- program all back end stuff in Haskell and compile to library - program all GUI stuff in *insert imperative language of choice" and link to the library for back end functionality
It seems the ultimate decoupling of interface from logic.
Matt
On 12/01/2005, at 2:33 PM, Duncan Coutts wrote:
On Tue, 2005-01-11 at 21:05 +0100, Dmitri Pissarenko wrote:
Hello!
I want to learn to create GUIs with Haskell.
Which GUI frameworks can you recommend?
wxHaskell is good for building portable GUIs. It has an extensive selection of widgets and has a good API.
gtk2hs is good for building GUIs that target the Linux/Gtk/Gnome platform (though it is portable to Windows). It is also an extensive toolkit. It allows you to visually design GUIs with the Glade user interface builder. The API style is currently more low level than that of wxHaskell or FLTK.
There is also a binding to FLTK which is a much simpler, more light weight portable graphics toolkit.
As far as I know, these are the only actively maintained GUI toolkits for Haskell at the moment.
Duncan (gtk2hs developer)
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On 12 Jan 2005, at 11:10, Matthew Roberts wrote:
Can anyone attest to the sense (or otherwise) of the following programming "pattern"
- program all back end stuff in Haskell and compile to library - program all GUI stuff in *insert imperative language of choice" and link to the library for back end functionality
It seems the ultimate decoupling of interface from logic.
This is roughly how I handled a recent project, in a mixture of ML and Java. Frankly I regret it: if I did it again, I would do the whole thing in ML (or perhaps haskell). Once you get used to languages with real higher-order features and powerful abstraction notions, it is a real pain reverting to a language like Java (or C or C++ or perl or...) ML, despite being thought of as a primarily functional language, is still (IMO, of course) a 'better' imperative language than Java, because of features like closures and local declaration of functions. I think the same holds of haskell using an appropriate monad instead of ML's imperative features. All this is of course entirely dependent on having a suitable GUI library or set of bindings for haskell. I haven't tried wxHaskell yet so I can't comment there. (And for some applications, some languages may be too slow, but I was ignoring efficiency in the above) Jules

On Wed, 2005-01-12 at 11:34 +0000, Jules Bean wrote:
On 12 Jan 2005, at 11:10, Matthew Roberts wrote: All this is of course entirely dependent on having a suitable GUI library or set of bindings for haskell. I haven't tried wxHaskell yet so I can't comment there. (And for some applications, some languages may be too slow, but I was ignoring efficiency in the above)
The nice thing about all the GUI binding libraries we have at the moment is that they are wrappers over C libraries so the speed of the GUI should be pretty good unless you install a really slow event handler that gets fired all the time. I'd go as far as to say that a wxHaskell or gtk2hs GUI should be faster than an equivalent Java AWT/Swing gui. :-) Duncan
participants (3)
-
Duncan Coutts
-
Jules Bean
-
Matthew Roberts