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 NAA24990; Sun, 30 May 2004 13:47: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 NAA24707 for ; Sun, 30 May 2004 13:47:16 +0200 (MET DST) From: ronniec95@lineone.net Received: from mk-smarthost-3.mail.uk.tiscali.com (mk-smarthost-3.mail.uk.tiscali.com [212.74.114.39]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i4UBlFSH027486 for ; Sun, 30 May 2004 13:47:16 +0200 Received: from mk-cpfront-4.mail.uk.tiscali.com ([212.74.114.6]:35524 helo=mk-cpfrontend.uk.tiscali.com) by mk-smarthost-3.mail.uk.tiscali.com with esmtp (Exim 4.30) id 1BUOmY-000AAt-LY; Sun, 30 May 2004 12:47:14 +0100 Received: from [141.228.156.225] by mk-cpfrontend.uk.tiscali.com with HTTP; Sun, 30 May 2004 12:47:14 +0100 Date: Sun, 30 May 2004 12:47:14 +0100 Message-ID: <40800C10000A6ABC@mk-cpfrontend-4.mail.uk.tiscali.com> In-Reply-To: Subject: RE: [Caml-list] Efficient C++ interfacing? To: "Brandon J. Van Every" , "caml" MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Miltered: at concorde with ID 40B9C9C3.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; ronniec:01 lineone:01 caml-list:01 interfacing:01 interfacing:01 brandon:99 caml-list:01 2004:99 pointers:01 binders:01 swig:01 swig:01 brandon:99 seattle:99 2004:99 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, I've done a fair amount of C interfacing with Ocaml. Although the auto-co= nversion tools are ok, it's usually simpler (and definitely faster in terms of per= formance) to roll your own I've found. And it's actually not that complicated for most things. Also with handrolling your own interface you'll get something that is mor= e ocaml like and makes more sense (from a usability perspective) than auto generated ones most of the time. This is from my experience only, and YMM= V. If you want specific examples, I can send you. Ronnie >-- Original Message -- >From: "Brandon J. Van Every" >To: "caml" >Subject: [Caml-list] Efficient C++ interfacing? >Date: Sun, 30 May 2004 00:41:31 -0700 > > >On the subject of C++, the archive is daunting and not terribly >informative. If this has been asked before and good answers have been >given, I'm happy for pointers. Otherwise, I figure it doesn't hurt to >ask the same questions at some repeating time interval. > >If one wants to interface native OCaml code to native C++ code for >performance reasons, what is a good way to go about it? Are there any >automated binders for this native-native linkage? I've been looking at >SWIG but am unsure if it's native-native. The OCaml SWIG author >suggested that the performance is more on par with calling a scripting >language, but maybe I misunderstood. I'd be interested in optimizing >that, but only if it's a reasonable architectural approach. I really >don't have a handle on what C++ <--> OCaml efforts are out there. >Anything other than SWIG? > >My challenge problem is providing OCaml bindings for The Nebula Device >2. http://nebuladevice.cubik.org. I do not wish to use their script >server interface. It looks like a relatively low performance binding - >adequate for scripts that aren't supposed to be fast, but really not >intended for native-native communication. Also, script servers can only= >interface nRoot objects, leaving a whole class of nNode objects that >must be accessed from C++. > > >Cheers, www.indiegamedesign.com >Brandon Van Every Seattle, WA > >"The pioneer is the one with the arrows in his back." > - anonymous entrepreneur > > >--- >Outgoing mail is certified Virus Free. >Checked by AVG anti-virus system (http://www.grisoft.com). >Version: 6.0.691 / Virus Database: 452 - Release Date: 5/26/2004 > > >Attachment: winmail.dat > ------------------- 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