[Haskell-cafe] Poll & plea: State of GUI & graphics libraries in Haskell

Jason Dagit dagitj at gmail.com
Fri Sep 27 19:36:18 CEST 2013

On Thu, Sep 26, 2013 at 8:32 PM, Conal Elliott <conal at conal.net> wrote:

> I'm polling to see whether there are will and expertise to reboot graphics
> and GUIs work in Haskell. I miss working on functional graphics and GUIs in
> Haskell, as I've been blocked for several years (eight?) due to the absence
> of low-level foundation libraries having the following properties:
> * cross-platform,
> * easily buildable,
> * GHCi-friendly, and
> * OpenGL-compatible.

GLFW-b satisfies all of these. There are two caveats: a) to use it with
GHCi you'll need to use ghc 7.8 (when it comes out in a week or two); b)
it's really only providing an OpenGL context and none of the other
traditional GUI things like widgets and font rendering.

As far as GHCi compatibility is concerned, the problem there isn't with
GLFW or the Haskell bindings. GHCi has been toxic to these sorts of
libraries for a long time due to some bugs and limitations. In GHC 7.8,
there is a change to use the system wide linker by default and that removes
one hurdle. The next hurdle is to make GHCi work better with libraries that
use thread local storage that is pinned to the process's original thread.
You can often workaround this limitation with -fghci-no-sandbox.

> The last several times I tried Gtk2hs, I was unable to compile it on my
> Mac. Years ago when I was able to compile, the GUIs looked and interacted
> like a Linux app, which made them awkward and upleasant to use. wxHaskell
> (whose API and visual appearance I prefered) has for years been
> incompatible with GHCi, in that the second time I open a top-level window,
> the host process (GHCi) dies abruptly. Since my GUI & graphics programs are
> often one-liners, and I tend to experiment a lot, using a full compilation
> greatly thwarts my flow. For many years, I've thought that the situation
> would eventually improve, since I'm far from the only person who wants GUIs
> or graphics from Haskell.

wxHaskell + GHCi is likely affected by some of the things I mention above.
You should give it another try when 7.8 lands.

I hope that helps,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130927/dfa36955/attachment.htm>

More information about the Haskell-Cafe mailing list