tags:

views:

2578

answers:

7

Which libraries can I use to build a GUI for a Erlang application? Please one option per answer.

+9  A: 

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

bmdhacks
This sounds like a lot of work. :-/
Adam Lindberg
A: 

I'm not sure there are any... but I found Erlbol on the web, and a X11 GUI which sounds interesting, and GTK2 (pdf link)

gbjbaanb
+3  A: 

For writing native GUIs for Erlang, wxErlang seems to be the most mature library today (also on SourceForge).

Adam Lindberg
+2  A: 

I find it a little puzzling that anyone would want to write a GUI for a Erlang program in something other than Erlang? Erlang's concurrency model makes it an excellent language to write GUIs in. UI elements and events map perfectly onto Erlang processes and messages.

JesperE
It's not that erlang wouldn't be well suited to a GUI, it's that because it's so good at network applications and message passing that it leads people away from hard-coding the UI interface directly into the erlang system.
bmdhacks
Instead, people generally write very thin clients that just relay button presses or other UI interactions back to the erlang app. This way, you don't have to depend on users actually having the erlang runtime on their system.
bmdhacks
Again, because erlang is mostly used for distributed server-side applications, there hasn't been much interest in giving it a GUI, even if it's well suited to the task.
bmdhacks
+4  A: 

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.

+6  A: 

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.

psyeugenic
A: 

I've posted a wxErlang tutorial at http://wxerlang.dougedmunds.com

Doug Edmunds