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 WAA18551; Fri, 17 May 2002 22:18:19 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA18623 for caml-list@pauillac.inria.fr; Fri, 17 May 2002 22:18:19 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA18071 for ; Fri, 17 May 2002 21:45:46 +0200 (MET DST) Received: from kruuna.Helsinki.FI (kruuna.helsinki.fi [128.214.205.14]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g4HJjjr15108 for ; Fri, 17 May 2002 21:45:45 +0200 (MET DST) Received: (from lealanko@localhost) by kruuna.Helsinki.FI (8.11.6/8.10.1) id g4HJjd601332; Fri, 17 May 2002 22:45:39 +0300 (EEST) Date: Fri, 17 May 2002 22:45:37 +0300 From: Lauri Alanko To: caml-list@inria.fr Subject: [Caml-list] CamlIDL and true abstract types Message-ID: <20020517224534.A697@kruuna.Helsinki.FI> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello. I recently learned of CamlIDL (thanks to the list), and tried it out. After trying it out for a while, it seems to me that an absolutely essential feature is missing: abstract types. With an abstract type I mean a type whose representation is known neither at the C side nor in the caml world. Typically these are of the form: typedef struct Foo_ Foo; Where the actual definition of struct Foo_ is completely missing from public headers, or even if it is not, its structure is supposed to be an implementation detail. These sorts of types are needed often enough in many bindings, and the Caml translation for Foo* should be clear: type foo Yet somehow there seems to be no direct way for doing this within CamlIDL. How come? Another funny thing about CamlIDL is that it translates everything _by value_. C structs are transformed to newly allocated caml blocks and vice versa. Yet often enough the _identity_ of the struct (ie. its physical address) is essential. And though CamlIDL provides the "ptr" translation for pointers, it uses Com.unique as the translation type instead of a pure abstract type. And it provides no way to directly access or modify fields of existing C structs. To my mind, this makes CamlIDL unusable for creating bindings for anything but the most simple-minded libraries. Yet many people seem to promote it. Have I misunderstood something? Lauri Alanko la@iki.fi ------------------- 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