From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 0E3EFBC75 for ; Thu, 17 Feb 2005 14:17:28 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j1HDHR3W022169 for ; Thu, 17 Feb 2005 14:17:27 +0100 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 OAA22506 for ; Thu, 17 Feb 2005 14:17:25 +0100 (MET) Received: from mail-white.research.att.com (mail-red.research.att.com [192.20.225.110]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j1HDHOXC026593 for ; Thu, 17 Feb 2005 14:17:24 +0100 Received: from [192.168.1.104] (vpn-19.research.att.com [135.207.240.19]) by bigmail.research.att.com (8.11.6+Sun/8.11.6) with ESMTP id j1HDHN328819; Thu, 17 Feb 2005 08:17:23 -0500 (EST) Subject: Re: [Caml-list] XQuery Implementation: Galax version 0.5.0 available From: Mary Fernandez To: skaller@users.sourceforge.net Cc: caml-list In-Reply-To: <1108603164.5483.374.camel@pelican.wigram> References: <1108600816.4522.1.camel@localhost.localdomain> <1108603164.5483.374.camel@pelican.wigram> Content-Type: text/plain Organization: AT&T Labs - Research Message-Id: <1108646225.5058.91.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-7) Date: Thu, 17 Feb 2005 08:17:05 -0500 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 42149967.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 42149964.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 idl:01 o'caml:01 api:01 api:01 o'caml:01 heap:01 runtime:01 wrote:01 wrote:01 apis:01 ocaml:01 capi:98 stub:01 stub:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: It's not hard, really, just tedious. Unfortunately, the Caml IDL tool only generates wrapper code for calling C from O'Caml, not vice versa, so we write that code by hand. In short: C_API_stub.c - contains our C API. This code handles converting C values to O'Caml values, setting up actual arguments to O'Caml functions, then calling the O'Caml callback functions. There's some messy memory/heap management code in here too Caml_API_stub.ml - contains wrapper functions that are called from C API. These functions are registered using the Callback module. They call our real Caml API. We create a shared library that contains our Caml library, the C_API stub, and the O'Caml runtime system. (IT's BIG!) And that gets linked with the user's C program. I hope that makes sense. Mary On Wed, 2005-02-16 at 20:19, skaller wrote: > On Thu, 2005-02-17 at 11:40, Mary Fernandez wrote: > > > Galax provides APIs for O'Caml, C, and Java and is implemented in > > O'Caml. > > I'm curious how you provide a CAPI for Ocaml code? -- Mary Fernandez AT&T Labs - Research