From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 3B6BEBBAF for ; Wed, 24 Nov 2010 22:38:06 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjsBAA8U7UzUGyoDkWdsb2JhbACjCRUBAQEBCQsKBxEDH75BhUcEimCDDxo X-IronPort-AV: E=Sophos;i="4.59,249,1288566000"; d="scan'208";a="89299091" Received: from smtp3-g21.free.fr ([212.27.42.3]) by mail1-smtp-roc.national.inria.fr with ESMTP; 24 Nov 2010 22:38:05 +0100 Received: from [192.168.0.11] (unknown [78.192.0.38]) by smtp3-g21.free.fr (Postfix) with ESMTP id C6642A626D; Wed, 24 Nov 2010 22:37:58 +0100 (CET) Message-ID: <4CED85B7.30803@lexifi.com> Date: Wed, 24 Nov 2010 22:37:59 +0100 From: Alain Frisch User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.12) Gecko/20101027 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Martin DeMello Cc: OCaml List Subject: Re: [Caml-list] Desktop GUI toolkits - current state of the art? References: <4CEC4EF0.30805@lexifi.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; frisch:01 frisch:01 lexifi:01 guis:01 ocaml:01 ocaml:01 guis:01 recursion:01 recursive:01 recursive:01 callbacks:01 resp:01 resp:01 wrote:01 rec:01 On 11/24/2010 10:47 AM, Martin DeMello wrote: > No, I'm on linux, but CSML does look very interesting. Does it work > well with Mono? Yes, CSML itself has been adapted to work with Mono and I did a few tests (some of screenshots show Windows Forms GUIs controlled by OCaml code, under Linux with Mono). External users reported successful uses as well. At some point, we tried to run our main application under Mono (the application is mostly OCaml, plus a very small amount of C#, and a lot of CSML to make big parts of .Net libraries available to OCaml). We quickly realized that some widgets which we use a lot in our application simply don't work very well under Mono. For instance, the WebBrowser control is quite broken under Mono. This really has nothing to do with CSML, it's just that relying on Mono only to get nice GUIs under Linux might not be optimal. > I'd love to read that when you do. I was surprised not to see much > interest in GUI DSLs in OCaml. What is generalised recursion? Being able to write things like: lazy let rec button1 = button ~click:(fun () -> button2 # disable) "Button1" and button2 = button ~click:(fun () -> button1 # disable) "Button2" in ... As the lazy keyword suggests, we rely on lazy evaluation to evaluate such recursive definitions. The code above is equivalent to: let rec button1 = lazy (button ~click:(fun () -> (Lazy.force button2) # disable) "Button1") and button2 = lazy (button ~click:(fun () -> (Lazy.force button1) # disable) "Button2" in ... (also replacing any instance of button1, resp. button2 in ... by Lazy.force button1, resp. Lazy.force button1). The little extension makes it easier to define in a single big recursive definition several widgets with associated callbacks and mutual interactions. Without the feature, the natural thing to do is to create widgets first and then bind events, which looks less functional (and less local). Alain