What libraries can I use to build a GUI with Erlang?

Solution 1:

For GUI application in Erlang you should use wxErlang which is included in the r13b release. The beta has been around on source for some time but is now, since r13a, included in the main OTP release.

Solution 2:

Most people don't code the actual GUI in Erlang. A more common approach would be to write the GUI layer in Java or C# and then talk to your Erlang app via a socket or pipe.

With that in mind, you probably want to look into various libraries for doing RPC between java or .Net applications and Erlang:

http://weblogs.asp.net/nleghari/archive/2008/01/08/integrating-net-and-erlang-using-otp-net.aspx

http://www.theserverside.com/tt/articles/article.tss?l=IntegratingJavaandErlang

EDIT If you're truly set on coding an interface in erlang, you might consider doing a web-based GUI served via Yaws, the erlang web server: http://yaws.hyber.org/appmods.yaws

Solution 3:

I'll violate the 'one option per post' request - sorry, but which tool to use really depends on what your priorities are.

One fairly stable library is gtkNode. It uses a simple but powerful way to map all GTK widgets to Erlang, and should continue to be stable across releases. It also works well with the Glade GUI builder. It's actively maintained by Erlang guru Mats Cronqvist, but it's of course best-effort.

WxWidgets is very promising and will hopefully become the main GUI library for Erlang, but it's still in beta, and the interface is not yet stable and no promises of backward compatibility are made yet.

So if you want to be a bit on the bleeding edge, WxWidgets may be your thing. Otherwise, gtkNode should give you a good-looking GUI with relative ease and safety.

The only officially supported GUI library for Erlang is GS, part of the OTP release and guaranteed to work with upcoming releases. So if this is more important than native look and feel and a modern looking facade, it may be an option.