Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
XQuery Implementation: Galax version 0.5.0 available
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-02-17 (13:17)
From: Mary Fernandez <mff@r...>
Subject: Re: [Caml-list] XQuery Implementation: Galax version 0.5.0 available
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 - 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.
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