caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
To: David MENTRE <dmentre@linux-france.org>
Cc: OCaml Mailing <caml-list@inria.fr>
Subject: Re: [Caml-list] OCaml vs Ada and/or GUI options
Date: Thu, 12 Sep 2013 07:03:19 +0900	[thread overview]
Message-ID: <843DB424-8563-45A7-A22A-2FA65338298B@math.nagoya-u.ac.jp> (raw)
In-Reply-To: <CAC3Lx=b6Ty-a=Su-cw6PWA9ad0=p6H=McfuC4a8d_MeSHwsb1Q@mail.gmail.com>

Hi David,

I know you just wrote this list as a kind answer, but I cannot resist giving my view :-)

On 2013/09/11, at 18:49, David MENTRE <dmentre@linux-france.org> wrote:
> 2013/9/11 Adrien Nader <adrien@notk.org>:
>> I'm trying to get a list of things that people find bad in (labl)gtk.
>> Would you be able to put clear words on what you dislike?
> 
> From past experiment, GUI of demexp OCaml application
> (http://www.linux-france.org/~dmentre/demexp/latest-src/demexp-book-0.8.2.pdf
> , look at part IV p. 90), about 5-8 years ago:
> 
>  1. Lack of documentation. LablGTK doc says "look at C GTK doc". But
> the lablgtk binding changes things compared to the C API, so this not
> a one-to-one mapping neither. And the "obvious" changes weren't so
> obvious to me. A tutorial made by a Korean guy IIRC helped a lot;

I'm certainly the one to blame for that. If Adrien can improve that, big thanks
to him.

Still, the concept for LablGTK was: provide access to the GTK+ API, but reduce
the cruft. So, it is type safe with (almost) no need for coercions, and packing
can be done on the same line. Ideally this should have been close to LablTk,
but GTK is much more complex than Tk.

>  2. Verbosity of GTK: it takes a lot of code to put 2 buttons
> together (probably not GTK specific). At one point I used the GTK
> graphical tool (can't remember its name) to design the GUI graphically
> and load it into OCaml as XML file. It improved a lot my productivity;

Cannot blame you for that. Actually this is the right way to go if you have little time.
Unfortunately, this makes code harder to maintain.

As Adrien pointed, even written by hand LablGTK is much shorter than its C equivalent.
A ratio of 1/3 at least.

>  3. As other said, GTK is dead end: bad support of non-Linux
> platforms, not a lot of developers, etc.  It was very difficult to get
> my labgtk application working on Windows. A windows developer helped
> me a lot: picking the good versions of libraries, solve Windows
> specific issues, etc. I couldn't have compiled my OCaml GTK GUI on
> Windows without him.

I'm a bit surprised, as I never had problems on windows.
More honestly, there is one problem: where to find the packages.
But once you got them, it works just fine.

On the other hand OSX support seems to be never completed. A pity.

>  4. The use of callbacks everywhere looks to me like writing
> spaghetti code. I still hope somebody will write an
> API/Framework/whatever were one writes declaratively how the GUI
> should react and interact with application code, and all the needed
> code is generated automatically. Adobe had such a tool at one point
> for its internal use (i.e. for its applications). I don't know if
> reactive approaches would help in that regard.

I would rather say that this looks like OO code :-)
I have no allergy to that, and OCaml allows you to write in a much
cleaner way than C. However, this is clearly not declarative.
There are lots of experiments about declarative GUI in the Haskell
community, but I have no experience on how it fares in practice.

BTW, lexifi has also some internal system to build GUIs automatically.
I don't know if there is a blog post on that.

> To answer original Gour question: I don't think anything in the OCaml
> world fits the bill (safe, available at long term, documented, big
> user community, ...). Should I do the same thing, I would write the
> GUI as an external process (probably in C++ Qt) and use a
> communication protocol to control it from my OCaml program. Or maybe
> use the binding with Tk, if the graphical aspect has improved.

For Tk, I wouldn't say that the graphics have improved much.
And LablTk may not support the latest features.
Still, of course we can improve it, and comments are welcome.
But don't expect anything professional.

I agree that support for Qt would be ideal, and I actual first worked
on a LablQt before starting LablGTK, but writing bindings is much
harder. With all its defaults, GTK was designed with other languages
in mind, and this makes a huge difference. In theory, with the latest
versions one should be able to generate the bindings completely
automatically (but this is still experimental in LablGTK).

Also, every time I talked about improving LablGTK, I have gotten
comments about GUIs being web-based these days, so that generating
JavaScript would be the way to go. Are there good solutions for that?

Jacques Garrigue

  parent reply	other threads:[~2013-09-11 22:03 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-10 21:09 Gour
2013-09-10 21:38 ` Paolo Donadeo
2013-09-11  5:24   ` Adrien Nader
2013-09-11  7:21     ` Kakadu
2013-09-11  8:21       ` [Caml-list] " Gour
2013-09-11  8:14     ` Gour
2013-09-11 18:17       ` Adrien Nader
2013-09-11 19:31         ` Gour
2013-09-11 19:53           ` Adrien Nader
2013-09-11 20:41             ` Gour
2013-09-11 21:01               ` Adrien Nader
2013-09-12  5:44                 ` Gour
2013-09-12  6:31                   ` Adrien Nader
2013-09-12  5:36             ` Gour
2013-09-12  6:48               ` Adrien Nader
2013-09-12  7:26                 ` Gour
2013-09-11 20:06         ` Jon Harrop
2013-09-11 20:48           ` Anthony Tavener
2013-09-11 21:04             ` Adrien Nader
2013-09-12 14:40             ` [Caml-list] " Jon Harrop
2013-09-12 14:51               ` Alain Frisch
2013-09-12 14:57                 ` Lukasz Stafiniak
2013-09-12 15:04                   ` Alain Frisch
2013-09-14  3:05                 ` Jon Harrop
2013-09-14  7:10                   ` Kakadu
2013-09-14 11:37                     ` Jon Harrop
2013-09-15  8:32                       ` Kakadu
2013-09-14 23:51                   ` Francois¡¡Charles Matthieu¡¡Berenger
2013-09-11 22:17           ` [Caml-list] " Richard W.M. Jones
2013-09-12 13:49             ` [Caml-list] " Jon Harrop
2013-09-12 13:58               ` Richard W.M. Jones
2013-09-11  9:49     ` David MENTRE
2013-09-11 10:14       ` Kakadu
2013-09-11 15:21         ` David MENTRE
2013-09-12  1:31           ` Francois Berenger
2013-09-11 18:43         ` Adrien Nader
2013-09-11 18:36       ` Adrien Nader
2013-09-11 19:34         ` [Caml-list] " Gour
2013-09-11 19:45           ` Adrien Nader
2013-09-11 22:06             ` [Caml-list] " Jacques Garrigue
2013-09-12  3:25         ` Ivan Gotovchits
2013-09-12  6:41         ` Adrien Nader
2013-09-12 11:49           ` Gerd Stolpmann
2013-09-11 19:17       ` [Caml-list] " Gour
2013-09-11 22:03       ` Jacques Garrigue [this message]
2013-09-12  8:16         ` [Caml-list] " Alain Frisch
2013-09-11 12:26     ` Jon Harrop
2013-09-11 18:48       ` Adrien Nader
2013-09-11 13:22     ` Paolo Donadeo
2013-09-11 13:33       ` Kakadu
2013-09-11 14:09         ` Paolo Donadeo
2013-09-11 19:36           ` Jon Harrop
2013-09-11 19:45             ` [Caml-list] " Gour
2013-09-12 12:55               ` [Caml-list] " Jon Harrop
2013-09-11 18:57       ` Adrien Nader
2013-09-11 19:01         ` Rudi Grinberg
2013-09-11 19:15           ` Adrien Nader
2013-09-11  8:10   ` [Caml-list] " Gour
2013-09-11  1:00 ` [Caml-list] " Francois Berenger
2013-09-11  5:07   ` rixed
2013-09-11  8:26     ` [Caml-list] " Gour
2013-09-11  9:23       ` rixed
2013-09-11 12:54         ` Leo White
2013-09-11 12:59           ` Gour
2013-09-11 19:06             ` Adrien Nader
2013-09-11  8:16   ` Gour
2013-09-11  9:00     ` Francois Berenger
2013-09-11 19:19       ` Gour
2013-11-17 20:12       ` [Caml-list] " Gour
2013-09-11  7:38 ` Gabriel Kerneis
2013-09-11  8:20   ` [Caml-list] " Gour
2013-09-11 11:42     ` Gerd Stolpmann
2013-09-18 11:42       ` [Caml-list] " Gour
2013-09-18 12:24         ` Gerd Stolpmann
2013-09-20  4:47           ` Gour
2013-09-19  8:11         ` Alain Frisch
2013-09-19  8:30           ` Daniel Bünzli
2013-09-19  8:47             ` Andreas Rossberg
2013-09-20  4:51           ` Gour
2013-09-20 12:04             ` Gerd Stolpmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=843DB424-8563-45A7-A22A-2FA65338298B@math.nagoya-u.ac.jp \
    --to=garrigue@math.nagoya-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=dmentre@linux-france.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).