From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 78608BB9A for ; Wed, 5 Oct 2005 00:00:33 +0200 (CEST) Received: from pih-relay06.plus.net (pih-relay06.plus.net [212.159.14.133]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j94M0WEJ002265 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Wed, 5 Oct 2005 00:00:32 +0200 Received: from [80.229.56.224] (helo=chetara) by pih-relay06.plus.net with esmtp (Exim) id 1EMupq-0003Ph-Kv for caml-list@yquem.inria.fr; Tue, 04 Oct 2005 23:00:30 +0100 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Automatic interfacing of ocaml to c? Date: Tue, 4 Oct 2005 22:56:44 +0100 User-Agent: KMail/1.7.2 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200510042256.44671.jon@ffconsultancy.com> X-Miltered: at concorde with ID 4342FB80.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 interfacing:01 ocaml:01 caml-list:01 camlidl:01 lablgl:01 bindings:01 camlidl:01 enumeration:01 variants:01 enumeration:01 lablgl:01 bindings:01 functors:01 ocaml:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Tuesday 04 October 2005 21:43, Chris Campbell wrote: > Message copied below, I sent it to the caml-list@inria.fr but it > doesn't show. Which is correct? caml-list@inria.fr or > caml-list@yquem.inria.fr? I received both the original and this duplicate. > Has anyone done any work on this? camlidl > I'm in the process of attempting a > semi autogenerated binding to opengl using the mesa xml specifications > of the interface and lablgl. Have you seen Isaac Trott's idlgl bindings, written using camlidl? > This is very early days; so far all I've > done is map the flat (a portion of the) gl enumeration space to a set > of types and values, then auto generate tables mapping the ml variants > to gl enumeration values ala lablgl. > > I have a good idea of what it will do and am just looking for advice > from anyone who has done this sort of thing before (if any). I have tried and failed to write bindings to the more complicated (read "hideous") parts of OpenGL and GLU, specifically the GLU tesselator. > The main > problems so far arise from the flat gl space and wanting to split that > up into a more friendly set of types and modules. There are also problems with typing, e.g. sets of related functions that handle polymorphic metadata of the same type between each of the functions. This could be implemented using functors, records of functions or objects. I'm not sure if it would be better to do more on the OCaml side using Obj or to use C. > In fact, I will only > be generating the mundane stuff as some of this mapping is quite > tricky and using that as a base. Many of the opengl functions are > trivially mapped to OCaml but those that don't will be hand coded. I'm keen to see your results! :-) -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists