Re: New C interfaces

From: Xavier Leroy (
Date: Wed Mar 19 1997 - 14:20:37 MET

From: Xavier Leroy <>
Message-Id: <>
Subject: Re: New C interfaces
In-Reply-To: <199703111931.LAA28111@vegemite.Stanford.EDU> from Andrew Conway at "Mar 11, 97 11:31:30 am"
To: arc@sequence.Stanford.EDU (Andrew Conway)
Date: Wed, 19 Mar 1997 14:20:37 +0100 (MET)

> I have been reading the 1.04 documentation on the C language
> interface, and it occured to me that one could get library routined
> compiled with ocamlopt to live in harmony with the top level by
> compiling the library routines using ocamlopt -output-obj, and then
> linking them into the toplevel using -custom. It looks messy but
> practical.

It almost works, but not quite. One problem is that one would need a
runtime library that supports both the bytecode and the native-code
system. In particular, the garbage collector would need to scan both
the interpreter stack and the native stack.

> Does this make multiple copies of the garbage collector?

At any rate, the C linker will not let you do that (duplicate symbols
are an error in C). Also, if you had two GCs, it would be hard to pass
allocated data structures from one world to the other.

- Xavier Leroy

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