To Learn More
For a better understanding of the C language, especially argument
passing and data representations, the book
C: a reference manual [HS94] is highly recommended.
Concerning exceptions and garbage collection, several works add these
missing features to C. The technical report [Rob89] describes
an implementation of exceptions in C, based on open macros and
on the setjmp and longjmp functions from the C library.
Hans Boehm distributes a conservative collector with ambiguous roots
that can be added (as a library) to any C program:
Link
http://www.hpl.hp.com/personal/Hans_Boehm/gc/
Concerning interoperability between Objective CAML and C, the tools
described in this chapter are rather low-level and difficult to use.
However, they give the programmer full control on copying or sharing
of data structures between the two languages. A higher-level tool
called CamlIDL is available; it automatically generates the
Objective CAML ``stubs'' (encapsulation functions) for calling C functions and
converting data types. The C types and functions are described in a
language called IDL (Interface Definition Language), similar to a subset of
C++ and C. This description is then passed through the CamlIDL
compiler, which generates the corresponding .mli, .ml and
.c files. This tool is distributed from the following page:
Link
http://caml.inria.fr/camlidl/
Other interfaces exist between Objective CAML and languages other than C.
They are available on the ``Caml hump'' page:
Link
http://caml.inria.fr/hump.html
They include several versions of interfaces with Fortran, and
also an Objective CAML bytecode interpreter written in Java.
Finally, interoperability between Objective CAML and other languages can
also be achieved via data exchanges between separate programs,
possibly over the network. This approach is described in the chapter
on distributed programming (see chapter 20).