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 LAA17050; Tue, 18 May 2004 11:25:17 +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 LAA17040 for ; Tue, 18 May 2004 11:25:16 +0200 (MET DST) Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i4I9PFSH018888 for ; Tue, 18 May 2004 11:25:15 +0200 Received: from localhost (akasha.ijm.jussieu.fr [134.157.173.57]) by shiva.jussieu.fr (8.12.11/jtpda-5.4) with ESMTP id i4I9PFL7019976 ; Tue, 18 May 2004 11:25:15 +0200 (CEST) X-Ids: 165 Date: Tue, 18 May 2004 11:25:06 +0200 (CEST) Message-Id: <20040518.112506.73847465.andrieu@ijm.jussieu.fr> To: skaller@users.sourceforge.net Cc: caml-list@inria.fr Subject: Re: [Caml-list] Automatic wrapper generator From: Olivier Andrieu In-Reply-To: <1084869517.19838.409.camel@pelican.wigram> References: <1084869517.19838.409.camel@pelican.wigram> X-Mailer: Mew version 4.0.64 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 40A9D67B.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at shiva.jussieu.fr with ID 40A9D67B.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Antivirus: scanned by sophie at shiva.jussieu.fr X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 andrieu:01 andrieu:01 2004:99 wrappers:01 annotations:01 foo:01 doubles:01 low-level:01 unsafe:01 ocaml:01 ocaml:01 caml:01 caml:01 camlidl:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk skaller [18 May 2004]: > This is a brief status report concerning the Felix > automatic wrapper generator (reason for posting to Caml list > explained below). [...] > Note of course the generated wrappers are, > at least currently, LOW LEVEL and thus not safe. > > for some time, people have been crying for 'MORE LIBRARIES' > for Ocaml. > > Here's your chance to get THE LOT in one go. I really don't buy this. There is just not enough information in the C prototypes to give you a reasonable interface for OCaml. Or does your generator use annotations (like camlIDL does) ? For instance, consider this prototype: int foo (double *, int); - the double* can be an array of doubles, an out parameter, an in/out parameter - the int parameter could be the length of the array, or a regular parameter - the int return type could really be a boolean Even if (double *, int) represents an array and its length, the caml interface is not obvious : float array -> int -> ... (straightforward mapping) float array -> ... (use the array length for the int parameter) float array -> pos:int -> len:int -> ... (account for pointer arithmetic) In the end you get at best a very low-level bunch of autogenerated unsafe externals, that you have to re-wrap in ocaml to get something comfortable and/or safe to program with. -- Olivier ------------------- 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