[Haskell-cafe] Status of Haskell + Mac + GUIs & graphics

Jason Dagit dagitj at gmail.com
Wed May 18 20:09:39 CEST 2011

On Tue, May 17, 2011 at 4:24 PM, Conal Elliott <conal at conal.net> wrote:
> I still haven't found any way to do GUIs or interactive graphics in Haskell
> on a Mac that isn't plagued one or more of the following serious problems:
> * Incompatible with ghci, e.g., fails to make a window frame or kills the
> process the second time one opens a top-level window,
> * Goes through the X server, and so doesn't look or act like a Mac app,
> * Doesn't support OpenGL.

Support for OpenGL comes in different levels of quality, as I'm
discovering.  It would seem that Mesa (ie., linux support), only
officially supports OpenGL 2.1 [1] despite being released on 6 April
2011.  I haven't been able to get OpenGL 3.0+ specific features to
work on linux with Haskell yet.

I find that you really want OpenGL 3.1 or newer.  The Khronos group
really did a lot of nice things with the 3.x specification and 4.x is
even better.

Some people in this thread have suggested doing web apps.  This won't
work well yet for people who want OpenGL support.  My experiments with
webgl show that it's not mature yet.  You have to target a specific
browser and OS at the moment, with linux having the worst support by
far.  Firefox 4 and Chrome on windows fair the best so far.

> A year or two ago, I put my Haskell GUI & graphics work on hold while
> waiting & hoping for a functioning pathway to open. So far I haven't heard
> of one.

Yes, I know the feeling all too well.  I'd like to fix this situation.
 I took over maintainership of the Haskell OpenGL bindings hoping that
I could improve them.  We now have a google summer of code student
working on the bindings to update them and improve the overall
quality.  That's just one piece of the puzzle.  If you'd like to
contribute to that piece of the puzzle we have an organization on
github for Haskell OpenGL:

Send some pull requests or add bug tickets!

As you point out we also need better libraries for creating the OpenGL
context.  I wrote up my searches on that front here:

My conclusion was that GLFW-b (on hackage) is the best we have right
now.  I think we could do even better than the C libraries out there
by writing the GLUT/GLFW/etc implementation purely in Haskell.  We
already have x11 and gtk bindings for the linux support.  We have
win32 api bindings for windows support.  What we are lacking is good
low level support for OSX GUI programming.  Once we have that it's not
too much of a stretch to use cabal to glue it together into a cross
platform library.  I believe that's the right way to go for the long
term.  Improving GLFW-b is a good short-term route.

And just to say it one more time, I can use all the help I can get.
There are a lot of yaks to be shaved.  My hope is that if we all shave
one yak then we'll quickly have the libraries we need to do some
serious graphics hacking in Haskell.  We already have many good
libraries for it, we just need to improve and polish a few key
libraries.  The momentum is here and a few people have already jumped
in.  Time to get on board!


More information about the Haskell-Cafe mailing list