[Haskell-cafe] Re: Haskellers hate GUIs!!

Evan Laforge qdunkan at gmail.com
Fri Apr 2 17:56:32 EDT 2010

This may not be helpful for you, but when I did GUI stuff with haskell
I wrote the GUI part in c++ with fltk, exposed a medium-level api
specific to that gui, and then call that api through the FFI.  This is
sort of like the web browser + backend thing, except switch c++ and
fltk for javascript and the browser, and you are making synchronous
FFI function calls instead of sending asynchronous JSON messages.

It has worked well for me so far, but my GUIs are all simple with well
defined interaction with the backend (i.e. backend says "add these 15
items" and GUI says "user selected this item").  If you have
complicated interaction between backend and GUI you may get tired
implementing a large API and lots of marshal/unmarshal.  Of course you
could still pass data via JSON or protobufs or something, and there
are various tools to automate wrapping large numbers of C calls.

In terms of distribution, you get a single binary and fltk is designed
for static linking.  You can run on X, mac, and windows, though it
doesn't look like a native app on any.

More information about the Haskell-Cafe mailing list