Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Desktop GUI toolkits - current state of the art?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-11-24 (15:56)
From: Andrei Formiga <andrei.formiga@g...>
Subject: Re: [Caml-list] Desktop GUI toolkits - current state of the art?
On Wed, Nov 24, 2010 at 11:06 AM, Michael Ekstrand <> wrote:
> On 11/24/2010 03:33 AM, Martin DeMello wrote:
>> On Wed, Nov 24, 2010 at 4:36 AM, Jacques Garrigue
>> <> wrote:
>>> I'm not sure which examples you looked at for lablgtk2.
>>> The goals of lablgtk are:
>>>  * be as close as possible to the spirit of Gtk+
>>>  * while providing type and memory safety
>>>  * and allow comfortable use through objects and optional arguments

>> That might be the problem, then. I was looking at the examples in the
>> translation of the gtk tutorial, and a lot of it seemed like C code
>> translated to OCaml. Could you point me to some example of code
>> written using the high level API?
> The LablGTK tutorial I am aware of[1] uses the high-level API.  The
> high-level API isn't notably higher-level than the base API in terms of
> what calls are necessary, but it wraps everything up in objects and
> makes the data structures nicer.  The API call sequences are roughly the
> same.
> - Michael
> 1.

It's a design decision. As the author of LablGTK said above, one of
its goals was to stay as close to possible as the original C API. This
has advantages (easy to transfer knowledge and documentation to the
OCaml side), and disadvantages (you miss on providing a nicer API that
would be possible with a more expressive language).

In the end the LablGTK API is only a bit nicer than the C API, so the
GUI part of a LablGTK program would be similar to the equivalent C
version. Unfortunately if you want a higher-level GUI library, I don't
see any viable alternative in OCaml right now.

[]s, Andrei Formiga