From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA00205; Fri, 12 Jul 2002 19:36:37 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA00213 for ; Fri, 12 Jul 2002 19:36:36 +0200 (MET DST) Received: from mail.interaktif.net.tr ([62.248.102.120]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g6CHaYf11425 for ; Fri, 12 Jul 2002 19:36:35 +0200 (MET DST) Received: from abn166-176.ank-avrupa-ports.kablonet.net.tr (unknown [195.174.166.176]) by mail.interaktif.net.tr (Postfix) with ESMTP id 752641E68E; Fri, 12 Jul 2002 20:34:46 +0300 (EEST) From: Eray Ozkural Organization: Bilkent University CS Dept. To: Stefano Zacchiroli , OCaml Subject: Re: [Caml-list] OCaml QT bindings Date: Fri, 12 Jul 2002 20:30:39 +0300 User-Agent: KMail/1.4.5 References: <200207081952.PAA28813@hickory.cc.columbia.edu> <200207120441.36695.erayo@cs.bilkent.edu.tr> <20020712081055.GD756@cs.unibo.it> In-Reply-To: <20020712081055.GD756@cs.unibo.it> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-Disposition: inline Message-Id: <200207122030.39591.erayo@cs.bilkent.edu.tr> Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Friday 12 July 2002 11:10, Stefano Zacchiroli wrote: > On Fri, Jul 12, 2002 at 04:41:36AM +0300, Eray Ozkural wrote: > > > Ohhhh.. just imagine if GTK/Gnome/Gui stuff on RH linux > > > were written in Ocaml .. it might actually work! > > > > You guys really need my ocaml bindings for Qt/KDE (assuming I finish > > writing it....) ;) > > Yup!!! I've been wondering for such a binding for months .... (anyway > the impressive work to build up one stops me from starting the work :-), > could you tell us when you expect to have a working version? > > BTW, obviously if you need help, feel free to ask! I think I will need help. The ocaml type system makes it very easy to get it right at the abstraction level but the mundane work of providing entry points for all Qt classes itself is not an easy task since you need a successful translator, or you will have to correct things by hand which is highly undesirable. I'm right now at the stage of writing a C++ parser that will be sufficient for header files in KDE. The parser isn't finished yet, but I've based it on a grammar which targeted part of the ISO standard so when it's done I think it will be worthwhile. Since I'm fond of parser combinators I'm writing the translator in Haskell language using Parsec library. I've thought about what should be involved in the library and it seems at least the following will be necessary: 1) "C" bindings which will be entry points for constructor/destructor, member functions and selector/modifier functions for each member variable in each Qt class... This will abstract away C++ dispatch, inline, etc. Template functions will not be addressed. (But it will not be a problem to implement things like QStringList which inherit from template classes....) 2) A mapping of class inheritance and subtyping relations to ocaml classes. This should be relatively straightforward since ocaml type/class system covers a lot more ground than C++. 3) A mapping of parameter passing, and "new" / "delete" to ocaml. We're passing mostly plain pointers/references in Qt, but I think there are cases where this is not true. The object model would be taken akin to Java where each object is allocated on the heap to simplify this matter. Optionally, I will see if I can come up with some ocaml code that will provide high level access to GUI code. The help I can use now is: do you observe any difficulties with the approach I have roughly outlined? And are there any vital points that I seem to be missing? Thanks, -- Eray Ozkural (exa) Comp. Sci. Dept., Bilkent University, Ankara www: http://www.cs.bilkent.edu.tr/~erayo Malfunction: http://mp3.com/ariza GPG public key fingerprint: 360C 852F 88B0 A745 F31B EA0F 7C07 AE16 874D 539C ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners