From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 26D49820A1 for ; Wed, 11 Sep 2013 20:36:31 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of adrien@notk.org) identity=pra; client-ip=91.121.71.147; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="adrien@notk.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of adrien@notk.org designates 91.121.71.147 as permitted sender) identity=mailfrom; client-ip=91.121.71.147; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="adrien@notk.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@nautica.notk.org) identity=helo; client-ip=91.121.71.147; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="postmaster@nautica.notk.org"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap8AALG2MFJbeUeTl2dsb2JhbABbFoMpg3y8WIEcFg4BAQEBAQgWBzyCJQEBAwEBI1YFCwsYAgIFEw4CAg8FGB0BExMUh2gKCK4lkXaBKY5BB4JpNIEAA5d4AYEvixOIVDo X-IPAS-Result: Ap8AALG2MFJbeUeTl2dsb2JhbABbFoMpg3y8WIEcFg4BAQEBAQgWBzyCJQEBAwEBI1YFCwsYAgIFEw4CAg8FGB0BExMUh2gKCK4lkXaBKY5BB4JpNIEAA5d4AYEvixOIVDo X-IronPort-AV: E=Sophos;i="4.90,885,1371074400"; d="scan'208";a="26526300" Received: from nautica.notk.org ([91.121.71.147]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 11 Sep 2013 20:36:30 +0200 Received: by nautica.notk.org (Postfix, from userid 1003) id E356CC009; Wed, 11 Sep 2013 20:36:29 +0200 (CEST) Date: Wed, 11 Sep 2013 20:36:29 +0200 From: Adrien Nader To: David MENTRE Cc: Paolo Donadeo , OCaml mailing list Message-ID: <20130911183629.GB3764@notk.org> References: <20130910230928.2d51cd39@atmarama.noip.me> <20130911052437.GA9514@notk.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: [Caml-list] OCaml vs Ada and/or GUI options On Wed, Sep 11, 2013, David MENTRE wrote: > Hello Adrien, > > 2013/9/11 Adrien Nader : > > 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: Some of your code from MiscUI overlaps with GUtil afaict. However, GUtil (along with some others) is not advertised as well as it should. I've started working on that by switching the lablgtk README to asciidoc which can be used to create browsable documents (with a TOC; webpages for instance) while still being readable with "cat" but it's not completed. > 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'd like to make another tutorial; a much shorter one that matches lablgtk's high-level API (and therefore conciness). Something like a 10-minutes tutorial; I'll try to get a list of topics for it. > 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; To put two buttons next to each other, something like this should be enough (fully untested): let hbox = GPack.vbox () in let btn1 = GButton.button ~packing:(hbox#pack ~text:"OK" () in let btn2 = GButton.button ~packing:(hbox#pack ~text:"NEIN!" () in ... Is it much more concise than what you had done? > 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 don't need to add anything except maybe mention my yypkg project with packages for Windows: http://yypkg.org/mingw-builds/ > 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'm afraid you'll find the same issues everywhere. One way or another it'll boil down to the same thing. I found that FRP can actually help. It can allow you to write your application logic in a functional style even though the GUI toolkit is imperative (and it should be since it deals with I/Os). I'm preparing a quick presentation for the next OUPS and I'll show some of this. I'm not ready yet though and I still need to finish writing, have it proof-read and, oh, ask for a slot (that might help). > 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. There are screenshots on the tk website. The aspect has improved through new themes (including ones for Windows and MacOS X, something that GTK+ really needs to do; yes, only a theme...) -- Adrien Nader