Re: ML extension language

From: Robbert VanRenesse (rvr@cs.cornell.edu)
Date: Fri Feb 28 1997 - 19:28:58 MET


Message-Id: <2.2.32.19970228182858.00af6658@popsrv.cs.cornell.edu>
Date: Fri, 28 Feb 1997 13:28:58 -0500
To: Xavier Leroy <Xavier.Leroy@inria.fr>,
From: Robbert VanRenesse <rvr@cs.cornell.edu>
Subject: Re: ML extension language

You may also wish to look at Camouflage 1.1 (from
ftp://www.cs.cornell.edu/pub/rvr/camou-1.1.tar.gz)
and camlp4 (in ftp://ftp.inria.fr/lang/chamau/).

Camouflage 1.1 is a tool that supports interfacing between C and OCaml.
Camouflage reads a .mli file and creates the necessary C interfaces to
the given module. This way the fact that a library is written in OCaml
can be ``camouflaged.'' Camouflage also supports creating OCaml interfaces
to C functions, and generates functions that convert between OCaml and C
data structures.

For example, let say "x.mli" contains the declaration "val add: int ->
int -> int". Then the command "camou x.mli" creates a file "x.c" that
contains the C function "int X_add(int, int)" which does all the stuff
necessary to invoke the ML function. Vice versa, the declaration
"external add: int -> int -> int" creates an ML function to invoke
a corresponding C function called add of that same signature.

Hopefully Xavier's stuff will make all this obsolete so I don't have
to support this any more!

Robbert

At 03:03 PM 2/28/97 +0100, Xavier Leroy wrote:
>> I realize that CAML already contains facilities for creating new
>> primitives in C, but the main difference is that in a caml program,
>> the main program is the interpreter for the caml virtual machine, whereas
>> in an extension language control resides in the application.
>
>Actually, it is possible to have the main program written in C and
>calling Caml functions when needed. Release 1.03 contains very
>preliminary support for this; the forthcoming release 1.04 provides
>better support and documentation for this feature.
>
>- Xavier Leroy
>
>
>
>



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:09 MET